Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#26692 closed Bug (fixed)

test_msgfmt_error_including_non_ascii failure on Windows

Reported by: Tim Graham Owned by: Ramiro Morales
Component: Internationalization Version: 1.10
Severity: Normal Keywords: msgfmt i18n windows compilemessages non-ascii unicode
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

i18n.test_compilation.CompilationErrorHandling.test_msgfmt_error_including_non_ascii

Traceback (most recent call last):
  File "C:\Jenkins\workspace\pull-requests-windows\database\sqlite3\label\windows\python\Python35\tests\i18n\test_compilation.py", line 187, in test_msgfmt_error_including_non_ascii
    call_command('compilemessages', locale=['ko'], verbosity=0)

Python 2.7: u"'\ufffd' cannot start a field name" not found in u"...'\xc5' cannot start a field name. ..."

Python 3.5: "'�' cannot start a field name" not found in "... 'Å' cannot start a field name. ..."

Change History (5)

comment:1 by Tim Graham, 8 years ago

On #django-dev, Ramiro says, "That \ufffd Unicode code point is «used to replace an incoming character whose value is unknown or unrepresentable in Unicode». That's what gives me the hint this is some encoding mi-coordination between the multiple parts involved that doesn't work on Windows like it does on Linux et al. My current plan would be to change the string we look for to simply "' cannot start a field name".

comment:2 by Ramiro Morales, 8 years ago

Has patch: set
Keywords: msgfmt i18n windows compilemessages non-ascii unicode added
Owner: changed from nobody to Ramiro Morales
Status: newassigned

comment:3 by Tim Graham, 8 years ago

Triage Stage: AcceptedReady for checkin

(copying this analysis from the pull request)

Combination of:

  • Peculiarities of GNU gettext tools handling of error reporting (via sdterr)
  • The fact that for this test we need to set the LANG env var to "C" to ensure such error messages are emitted in English
  • Special characteristics of the Windows console regarding handling of encoding

Makes it hard to portably test for the actual content of the msgfmt(1)
error message that includes the culprit Unicode code point, as exercised
by the i18n.test_compilation.CompilationErrorHandling.test_msgfmt_error_including_non_ascii
test.

Proposed solution is to simply drop it but still check for other parts
of the expected error message.

comment:4 by Tim Graham <timograham@…>, 8 years ago

Resolution: fixed
Status: assignedclosed

In 71421e8f:

Fixed #26692 -- Relaxed an i18n compilemessages test.

The actual non-ASCII character differs on Windows.

comment:5 by Tim Graham <timograham@…>, 8 years ago

In 777bc8f7:

[1.10.x] Fixed #26692 -- Relaxed an i18n compilemessages test.

The actual non-ASCII character differs on Windows.

Backport of 71421e8f8766525e709397f14e100f2846849df0 from master

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