Opened 5 years ago

Closed 5 years ago

#19942 closed Bug (fixed)

Test failure

Reported by: Aymeric Augustin Owned by: nobody
Component: Internationalization Version: master
Severity: Release blocker Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no


Since a few days (maybe since the modeltests/regressiontests merge) I'm seeing this failure when running the tests (OS X, Python 2.7):

ERROR: test_error_reported_by_msgfmt (i18n.commands.compilation.CompilationErrorHandling)
Traceback (most recent call last):
  File "/Users/myk/Documents/dev/django/tests/i18n/commands/", line 113, in test_error_reported_by_msgfmt
    call_command('compilemessages', locale=self.LOCALE, stderr=StringIO())
  File "/Users/myk/Documents/dev/django/django/core/management/", line 161, in call_command
    return klass.execute(*args, **defaults)
  File "/Users/myk/Documents/dev/django/django/core/management/", line 283, in execute
    output = self.handle(*args, **options)
  File "/Users/myk/Documents/dev/django/django/core/management/commands/", line 68, in handle
    compile_messages(self.stderr, locale=locale)
  File "/Users/myk/Documents/dev/django/django/core/management/commands/", line 50, in compile_messages
    msg = "Execution of %s failed: %s" % (program, errors)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 94: ordinal not in range(128)


Attachments (1)

19942-1.diff (780 bytes) - added by Claude Paroz 5 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 5 years ago by Claude Paroz

Hé hé... the French utf-8-encoded error message from msgfmt is disturbing you :-)

More seriously, we should decode the errors content that come from Popen.communicate, now that we have a nice wrapper for it (popen_wrapper). Are we going to assume a hard-coded 'utf-8' terminal encoding, or do we want to try being clever (not a problem on Py3). get_system_username taught us that it might reveal harder than expected...

comment:2 Changed 5 years ago by Claude Paroz

Might be another use case for django.utils.encoding.DEFAULT_LOCALE_ENCODING.

Changed 5 years ago by Claude Paroz

Attachment: 19942-1.diff added

comment:3 Changed 5 years ago by Claude Paroz

Easy pickings: set
Has patch: set

comment:4 Changed 5 years ago by Aymeric Augustin

Triage Stage: AcceptedReady for checkin

That fixes the failure I was seeing.

comment:5 Changed 5 years ago by Claude Paroz <claude@…>

Resolution: fixed
Status: newclosed

In e4bf0f2c367ca77266900af3461e1ec440c8689d:

Fixed #19942 -- Decoded errors coming from Popen commands

Thanks Aymeric Augustin for reporting the issue.

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