1
0
mirror of https://github.com/django/django.git synced 2025-10-29 00:26:07 +00:00

[1.6.x] Fixed #22565 -- Prevented pgettext_lazy crash with bytestring input

Thanks ygbo for the report.
Backport of 142c27218 from master.
This commit is contained in:
Claude Paroz
2014-05-02 19:31:22 +02:00
parent b97b24882c
commit 034866204b
3 changed files with 20 additions and 4 deletions

View File

@@ -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):