Opened 11 years ago

Closed 11 years ago

#19942 closed Bug (fixed)

Test failure

Reported by: Aymeric Augustin Owned by: nobody
Component: Internationalization Version: dev
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

Description

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/compilation.py", 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/__init__.py", line 161, in call_command
    return klass.execute(*args, **defaults)
  File "/Users/myk/Documents/dev/django/django/core/management/base.py", line 283, in execute
    output = self.handle(*args, **options)
  File "/Users/myk/Documents/dev/django/django/core/management/commands/compilemessages.py", line 68, in handle
    compile_messages(self.stderr, locale=locale)
  File "/Users/myk/Documents/dev/django/django/core/management/commands/compilemessages.py", 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 11 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 by Claude Paroz, 11 years ago

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 by Claude Paroz, 11 years ago

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

by Claude Paroz, 11 years ago

Attachment: 19942-1.diff added

comment:3 by Claude Paroz, 11 years ago

Easy pickings: set
Has patch: set

comment:4 by Aymeric Augustin, 11 years ago

Triage Stage: AcceptedReady for checkin

That fixes the failure I was seeing.

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

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