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:22 +0200
commit142c27218a0bb07bb197faab7b1d8eb3a084f5b9 (patch)
tree7d4994c7f122eecea88efb8914fe56a8b5b0ca13 /django
parentd1799233f46c39379fe429a4ece128d96b128006 (diff)
Fixed #22565 -- Prevented pgettext_lazy crash with bytestring input
Thanks ygbo for the report.
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 d3d7699dec..f1497ca728 100644
--- a/django/utils/translation/trans_real.py
+++ b/django/utils/translation/trans_real.py
@@ -314,7 +314,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