summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2014-05-02 19:31:22 +0200
committerClaude Paroz <claude@2xlibre.net>2014-05-02 19:33:58 +0200
commit61fd00d4fd65f44d0a05be4c7e95124e4102ec27 (patch)
treeb2bcab313702d49bec4b3b39b4b1bfa927da59a5 /django
parent35b7dd4ddbedb6cfdef8a0a758de5e941a8fd36c (diff)
[1.7.x] Fixed #22565 -- Prevented pgettext_lazy crash with bytestring input
Thanks ygbo for the report. Backport of 142c27218 from master.
Diffstat (limited to 'django')
-rw-r--r--django/utils/translation/trans_real.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/django/utils/translation/trans_real.py b/django/utils/translation/trans_real.py
index 6bbdbe5f20..4f07012149 100644
--- a/django/utils/translation/trans_real.py
+++ b/django/utils/translation/trans_real.py
@@ -322,7 +322,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