[Django] #36421: Support for msgfmt==0.25

19 views
Skip to first unread message

Django

unread,
May 27, 2025, 9:55:20 AMMay 27
to django-...@googlegroups.com
#36421: Support for msgfmt==0.25
-------------------------------------+-------------------------------------
Reporter: Mohammad Ali | Type:
Mehdizadeh | Uncategorized
Status: new | Component:
| Uncategorized
Version: dev | Severity: Normal
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
When I run tests on my machine with msgfmt==0.25, one test failed:

```
======================================================================
FAIL: test_msgfmt_error_including_non_ascii
(i18n.test_compilation.CompilationErrorHandling.test_msgfmt_error_including_non_ascii)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/mam/.pyenv/versions/3.12.5/lib/python3.12/unittest/case.py",
line 58, in testPartExecutor
yield
File "/home/mam/.pyenv/versions/3.12.5/lib/python3.12/unittest/case.py",
line 634, in run
self._callTestMethod(testMethod)
^^^^^^^^^^^^^^^^^
File "/home/mam/.pyenv/versions/3.12.5/lib/python3.12/unittest/case.py",
line 589, in _callTestMethod
if method() is not None:
^^^^^^^^^^^^^^^^^
File "/home/mam/mycode/django/tests/i18n/test_compilation.py", line 281,
in test_msgfmt_error_including_non_ascii
self.assertIn("' cannot start a field name", stderr.getvalue())
^^^^^^^^^^^^^^^^^
File "/home/mam/.pyenv/versions/3.12.5/lib/python3.12/unittest/case.py",
line 1152, in assertIn
self.fail(self._formatMessage(msg, standardMsg))
^^^^^^^^^^^^^^^^^
File "/home/mam/.pyenv/versions/3.12.5/lib/python3.12/unittest/case.py",
line 715, in fail
raise self.failureException(msg)
^^^^^^^^^^^^^^^^^
AssertionError: "' cannot start a field name" not found in "Execution of
msgfmt failed:
/tmp/django_6kqdkmj8/i18n_i8h9ij4r/commands/locale/ko/LC_MESSAGES/django.po:24:
'msgstr' is not a valid Python brace format string, unlike 'msgid'.
Reason: In the directive number 0, a field name starts with a character
that is not alphanumerical or underscore.\nmsgfmt: found 1 fatal error\n"

----------------------------------------------------------------------
Ran 17523 tests in 155.582s

FAILED (failures=1, skipped=1597, expected failures=5)
```
--
Ticket URL: <https://code.djangoproject.com/ticket/36421>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 27, 2025, 9:56:15 AMMay 27
to django-...@googlegroups.com
#36421: Support for msgfmt==0.25
-------------------------------------+-------------------------------------
Reporter: Mohammad Ali | Owner: (none)
Mehdizadeh |
Type: Uncategorized | Status: new
Component: Uncategorized | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Mohammad Ali Mehdizadeh:

Old description:
New description:
--
Ticket URL: <https://code.djangoproject.com/ticket/36421#comment:1>

Django

unread,
May 29, 2025, 7:47:37 AMMay 29
to django-...@googlegroups.com
#36421: Support for msgfmt==0.25
-------------------------------------+-------------------------------------
Reporter: Mohammad Ali | Owner: (none)
Mehdizadeh |
Type: Uncategorized | Status: new
Component: Uncategorized | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Natalia Bidart):

Hello Mohammad Ali Mehdizadeh, thank you for your report. Can you please
provide details of what operating system and version are you using?
--
Ticket URL: <https://code.djangoproject.com/ticket/36421#comment:2>

Django

unread,
Jun 2, 2025, 2:29:32 PMJun 2
to django-...@googlegroups.com
#36421: Support for msgfmt==0.25
-------------------------------------+-------------------------------------
Reporter: Mohammad Ali | Owner: (none)
Mehdizadeh |
Type: | Status: new
Cleanup/optimization |
Component: | Version: dev
Internationalization |
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
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

* component: Uncategorized => Internationalization
* stage: Unreviewed => Accepted
* type: Uncategorized => Cleanup/optimization

Comment:

I have downloaded gettext 0.25 and built it locally. I have pointed my
terminal at the built libs and binaries:
{{{
$ msgfmt --version
msgfmt (GNU gettext-tools) 0.25
}}}

I can confirm that the test in the description fails for `gettext` version
0.25. It's worth noting that 0.25 is not easily available (yet). While
[https://mlocati.github.io/articles/gettext-iconv-windows.html binaries
are available for Windows], [https://launchpad.net/ubuntu/+source/gettext
latest version of Ubuntu is still shipping 0.23].
--
Ticket URL: <https://code.djangoproject.com/ticket/36421#comment:3>

Django

unread,
Jun 2, 2025, 3:36:08 PMJun 2
to django-...@googlegroups.com
#36421: Support for msgfmt==0.25
-------------------------------------+-------------------------------------
Reporter: Mohammad Ali | Owner: (none)
Mehdizadeh |
Type: | Status: new
Cleanup/optimization |
Component: | Version: dev
Internationalization |
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
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

* cc: Claude Paroz (added)

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

Django

unread,
Jun 3, 2025, 6:09:56 AMJun 3
to django-...@googlegroups.com
#36421: Support for msgfmt==0.25
-------------------------------------+-------------------------------------
Reporter: Mohammad Ali | Owner: (none)
Mehdizadeh |
Type: | Status: new
Cleanup/optimization |
Component: | Version: dev
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Claude Paroz):

* easy: 0 => 1

Comment:

I guess it's a matter of adapting the expected error message.
--
Ticket URL: <https://code.djangoproject.com/ticket/36421#comment:5>

Django

unread,
Jun 5, 2025, 3:36:40 PMJun 5
to django-...@googlegroups.com
#36421: Support for msgfmt==0.25
-------------------------------------+-------------------------------------
Reporter: Mohammad Ali | Owner: Jericho
Mehdizadeh | Serrano
Type: | Status: assigned
Cleanup/optimization |
Component: | Version: dev
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jericho Serrano):

* owner: (none) => Jericho Serrano
* status: new => assigned

--
Ticket URL: <https://code.djangoproject.com/ticket/36421#comment:6>

Django

unread,
Jun 5, 2025, 5:07:23 PMJun 5
to django-...@googlegroups.com
#36421: Support for msgfmt==0.25
-------------------------------------+-------------------------------------
Reporter: Mohammad Ali | Owner: Jericho
Mehdizadeh | Serrano
Type: | Status: assigned
Cleanup/optimization |
Component: | Version: dev
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jericho Serrano):

* has_patch: 0 => 1

Comment:

Made a PR: https://github.com/django/django/pull/19530
--
Ticket URL: <https://code.djangoproject.com/ticket/36421#comment:7>

Django

unread,
Jun 5, 2025, 5:09:23 PMJun 5
to django-...@googlegroups.com
#36421: Support for msgfmt==0.25
-------------------------------------+-------------------------------------
Reporter: Mohammad Ali | Owner: Jericho
Mehdizadeh | Serrano
Type: | Status: assigned
Cleanup/optimization |
Component: | Version: dev
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jericho Serrano):

Replying to [comment:7 Jericho Serrano]:
Ah linter errors
--
Ticket URL: <https://code.djangoproject.com/ticket/36421#comment:8>

Django

unread,
Jun 6, 2025, 4:20:26 AMJun 6
to django-...@googlegroups.com
#36421: Support for msgfmt==0.25
-------------------------------------+-------------------------------------
Reporter: Mohammad Ali | Owner: Jericho
Mehdizadeh | Serrano
Type: | Status: assigned
Cleanup/optimization |
Component: | Version: dev
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* needs_better_patch: 0 => 1

--
Ticket URL: <https://code.djangoproject.com/ticket/36421#comment:9>

Django

unread,
Jun 10, 2025, 10:51:02 AMJun 10
to django-...@googlegroups.com
#36421: Support for msgfmt==0.25
-------------------------------------+-------------------------------------
Reporter: Mohammad Ali | Owner: Jericho
Mehdizadeh | Serrano
Type: | Status: assigned
Cleanup/optimization |
Component: | Version: dev
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jericho Serrano):

* needs_better_patch: 1 => 0

--
Ticket URL: <https://code.djangoproject.com/ticket/36421#comment:10>

Django

unread,
Jun 11, 2025, 4:43:50 AMJun 11
to django-...@googlegroups.com
#36421: Support for msgfmt==0.25
-------------------------------------+-------------------------------------
Reporter: Mohammad Ali | Owner: Jericho
Mehdizadeh | Serrano
Type: | Status: assigned
Cleanup/optimization |
Component: | Version: dev
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* stage: Accepted => Ready for checkin

--
Ticket URL: <https://code.djangoproject.com/ticket/36421#comment:11>

Django

unread,
Jun 11, 2025, 11:09:27 AMJun 11
to django-...@googlegroups.com
#36421: Support for msgfmt==0.25
-------------------------------------+-------------------------------------
Reporter: Mohammad Ali | Owner: Jericho
Mehdizadeh | Serrano
Type: | Status: closed
Cleanup/optimization |
Component: | Version: dev
Internationalization |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce <42296566+sarahboyce@…>):

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

Comment:

In [changeset:"1960ecd879ce351226b36e7ac0aa25616241b6f6" 1960ecd8]:
{{{#!CommitTicketReference repository=""
revision="1960ecd879ce351226b36e7ac0aa25616241b6f6"
Fixed #36421 -- Made test_msgfmt_error_including_non_ascii compatible with
msgfmt 0.25.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36421#comment:12>
Reply all
Reply to author
Forward
0 new messages