diff options
| author | Claude Paroz <claude@2xlibre.net> | 2014-05-02 19:31:22 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2014-05-02 19:38:46 +0200 |
| commit | 034866204b39f797c73997b03cd90443aa03aa91 (patch) | |
| tree | 7ce82f5f79308861e1c7be0003350996ea8be0a0 /django/utils | |
| parent | b97b24882c7c3363d6972fe1f3a5573738cf9d5a (diff) | |
[1.6.x] Fixed #22565 -- Prevented pgettext_lazy crash with bytestring input
Thanks ygbo for the report.
Backport of 142c27218 from master.
Diffstat (limited to 'django/utils')
| -rw-r--r-- | django/utils/translation/trans_real.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/django/utils/translation/trans_real.py b/django/utils/translation/trans_real.py index 195badfc00..789d59e2ba 100644 --- a/django/utils/translation/trans_real.py +++ b/django/utils/translation/trans_real.py @@ -285,7 +285,8 @@ def pgettext(context, message): result = ugettext(msg_with_ctxt) if CONTEXT_SEPARATOR in result: # Translation not found - result = message + # force unicode, because lazy version expects unicode + result = force_text(message) return result def gettext_noop(message): |
