#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 , 9 years ago
comment:2 by , 9 years ago
Has patch: | set |
---|---|
Keywords: | msgfmt i18n windows compilemessages non-ascii unicode added |
Owner: | changed from | to
Status: | new → assigned |
comment:3 by , 9 years ago
Triage Stage: | Accepted → Ready 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.
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".