Opened 7 years ago

Closed 7 years ago

#16124 closed Bug (duplicate)

makemessages failed with UnicodeDecodeError

Reported by: serg.partizan@… Owned by: nobody
Component: Uncategorized Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX:


python makemessages -l ru
processing language ru
Traceback (most recent call last):
  File "", line 11, in <module>
  File "/usr/lib/python2.7/site-packages/django/core/management/", line 438, in execute_manager
  File "/usr/lib/python2.7/site-packages/django/core/management/", line 379, in execute
  File "/usr/lib/python2.7/site-packages/django/core/management/", line 191, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/lib/python2.7/site-packages/django/core/management/", line 220, in execute
    output = self.handle(*args, **options)
  File "/usr/lib/python2.7/site-packages/django/core/management/", line 351, in handle
    return self.handle_noargs(**options)
  File "/usr/lib/python2.7/site-packages/django/core/management/commands/", line 365, in handle_noargs
    make_messages(locale, domain, verbosity, process_all, extensions, symlinks, ignore_patterns, no_wrap, no_obsolete)
  File "/usr/lib/python2.7/site-packages/django/core/management/commands/", line 233, in make_messages
    f.write(templatize(src, orig_file[2:]))
  File "/usr/lib/python2.7/site-packages/django/utils/translation/", line 127, in templatize
    return _trans.templatize(src, origin)
  File "/usr/lib/python2.7/site-packages/django/utils/translation/", line 450, in templatize
    content = u''.join(comment)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd1 in position 11: ordinal not in range(128)

This error happens when parsing template with {% comment %} some cyrillic text {% endcomment %}
I was fixed this for myself in this way:

content = u''.join(map(lambda s: s.decode('utf-8'), comment))

in /usr/lib/python2.7/site-packages/django/utils/translation/ at line 450

Change History (1)

comment:1 Changed 7 years ago by Ramiro Morales

Resolution: duplicate
Status: newclosed

Duplicate of #15848 -- Unfortunately this bug is present in 1.3, was fixed afterwards in the 1.3.X branch and that fix will be available in a future 1.3.1 release. You might want to use a SVN checkout of that branch for the time being.

Note: See TracTickets for help on using tickets.
Back to Top