[Django] #26692: test_msgfmt_error_including_non_ascii failure on Windows

8 views
Skip to first unread message

Django

unread,
May 31, 2016, 12:13:02 PM5/31/16
to django-...@googlegroups.com
#26692: test_msgfmt_error_including_non_ascii failure on Windows
------------------------------------------------+------------------------
Reporter: timgraham | Owner: nobody
Type: Bug | Status: new
Component: Internationalization | Version: 1.10
Severity: Normal | Keywords:
Triage Stage: Accepted | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
`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. ..."

--
Ticket URL: <https://code.djangoproject.com/ticket/26692>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 31, 2016, 2:14:56 PM5/31/16
to django-...@googlegroups.com
#26692: test_msgfmt_error_including_non_ascii failure on Windows
--------------------------------------+------------------------------------

Reporter: timgraham | Owner: nobody
Type: Bug | Status: new
Component: Internationalization | Version: 1.10
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by timgraham):

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".

--
Ticket URL: <https://code.djangoproject.com/ticket/26692#comment:1>

Django

unread,
May 31, 2016, 5:23:38 PM5/31/16
to django-...@googlegroups.com
#26692: test_msgfmt_error_including_non_ascii failure on Windows
-------------------------------------+-------------------------------------
Reporter: timgraham | Owner: ramiro
Type: Bug | Status: assigned
Component: | Version: 1.10
Internationalization |
Severity: Normal | Resolution:
Keywords: msgfmt i18n windows | Triage Stage: Accepted
compilemessages non-ascii unicode |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by ramiro):

* owner: nobody => ramiro
* keywords: => msgfmt i18n windows compilemessages non-ascii unicode
* has_patch: 0 => 1
* status: new => assigned


Comment:

[https://github.com/django/django/pull/6681 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/26692#comment:2>

Django

unread,
Jun 1, 2016, 9:19:33 AM6/1/16
to django-...@googlegroups.com
#26692: test_msgfmt_error_including_non_ascii failure on Windows
-------------------------------------+-------------------------------------
Reporter: timgraham | Owner: ramiro
Type: Bug | Status: assigned
Component: | Version: 1.10
Internationalization |
Severity: Normal | Resolution:
Keywords: msgfmt i18n windows | Triage Stage: Ready for
compilemessages non-ascii unicode | checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* stage: Accepted => Ready for checkin


Comment:

(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.

--
Ticket URL: <https://code.djangoproject.com/ticket/26692#comment:3>

Django

unread,
Jun 1, 2016, 9:21:15 AM6/1/16
to django-...@googlegroups.com
#26692: test_msgfmt_error_including_non_ascii failure on Windows
-------------------------------------+-------------------------------------
Reporter: timgraham | Owner: ramiro
Type: Bug | Status: closed
Component: | Version: 1.10
Internationalization |
Severity: Normal | Resolution: fixed

Keywords: msgfmt i18n windows | Triage Stage: Ready for
compilemessages non-ascii unicode | checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"71421e8f8766525e709397f14e100f2846849df0" 71421e8f]:
{{{
#!CommitTicketReference repository=""
revision="71421e8f8766525e709397f14e100f2846849df0"
Fixed #26692 -- Relaxed an i18n compilemessages test.

The actual non-ASCII character differs on Windows.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26692#comment:4>

Django

unread,
Jun 1, 2016, 9:28:43 AM6/1/16
to django-...@googlegroups.com
#26692: test_msgfmt_error_including_non_ascii failure on Windows
-------------------------------------+-------------------------------------
Reporter: timgraham | Owner: ramiro
Type: Bug | Status: closed
Component: | Version: 1.10
Internationalization |
Severity: Normal | Resolution: fixed
Keywords: msgfmt i18n windows | Triage Stage: Ready for
compilemessages non-ascii unicode | checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"777bc8f7d660147a40b61195d2e9cfa8d9750f09" 777bc8f7]:
{{{
#!CommitTicketReference repository=""
revision="777bc8f7d660147a40b61195d2e9cfa8d9750f09"
[1.10.x] Fixed #26692 -- Relaxed an i18n compilemessages test.

The actual non-ASCII character differs on Windows.

Backport of 71421e8f8766525e709397f14e100f2846849df0 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26692#comment:5>

Reply all
Reply to author
Forward
0 new messages