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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user