diff options
| author | Claude Paroz <claude@2xlibre.net> | 2012-11-14 10:50:15 +0100 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2012-11-14 10:50:15 +0100 |
| commit | 550ddc66b496473c8ee282c7ab6be5885a359d75 (patch) | |
| tree | 03cb8eaccb5aad52db8181d97e43f3735b6362a5 /django | |
| parent | 1620c27936718a87bbc8acce7886ef20fee2b3fe (diff) | |
Fixed #19272 -- Fixed gettext_lazy returned type on Python 2
Thanks tyrion for the report.
Diffstat (limited to 'django')
| -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 9e94840ee0..1bcef2d8de 100644 --- a/django/utils/translation/trans_real.py +++ b/django/utils/translation/trans_real.py @@ -246,7 +246,8 @@ def do_translate(message, translation_function): """ global _default - eol_message = message.replace('\r\n', '\n').replace('\r', '\n') + # str() is allowing a bytestring message to remain bytestring on Python 2 + eol_message = message.replace(str('\r\n'), str('\n')).replace(str('\r'), str('\n')) t = getattr(_active, "value", None) if t is not None: result = getattr(t, translation_function)(eol_message) |
