﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
22565	"pgettext_lazy returns ""unexpected type"""	ygbo	Claude Paroz	"The issue is similar to https://code.djangoproject.com/ticket/19272 but with pgettext_lazy:
{{{
In [1]: from django.utils.translation import pgettext_lazy

In [2]: s = pgettext_lazy(""a context"", ""foo bar"")  # using bytestring

In [3]: s.upper()
/usr/lib/python2.7/dist-packages/django/db/backends/sqlite3/base.py:53: RuntimeWarning: SQLite received a naive datetime (2014-04-29 12:18:28.940685) while time zone support is active.
  RuntimeWarning)

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/usr/lib/python2.7/dist-packages/django/core/management/commands/shell.pyc in <module>()
----> 1 s.upper()

/usr/lib/python2.7/dist-packages/django/utils/functional.pyc in __wrapper__(self, *args, **kw)
    121                     if t in self.__dispatch:
    122                         return self.__dispatch[t][funcname](res, *args, **kw)
--> 123                 raise TypeError(""Lazy object returned unexpected type."")
    124 
    125             if klass not in cls.__dispatch:

TypeError: Lazy object returned unexpected type.

In [4]: s = pgettext_lazy(""a context"", u""foo bar"")  # using unicode string

In [5]: s.upper()
Out[5]: u'FOO BAR'
}}}"	Bug	closed	Internationalization	1.5	Normal	fixed			Accepted	0	0	0	0	0	0
