[Django] #29061: manage.py makemessages throws syntax error due to incorrectly generated django.pot, again

10 views
Skip to first unread message

Django

unread,
Jan 25, 2018, 7:41:10 AM1/25/18
to django-...@googlegroups.com
#29061: manage.py makemessages throws syntax error due to incorrectly generated
django.pot, again
-------------------------------------+-------------------------------------
Reporter: Kyan | Owner: nobody
Type: Bug | Status: new
Component: Core | Version: 2.0
(Management commands) | Keywords: gettext,
Severity: Normal | makemessages, Windows
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
https://code.djangoproject.com/ticket/28773

I met the same problem, exactly like the ticket above.
I am using Django 2.0.1 and after check the django codes, I confirm that
fix is in my django. But that fix doesn't work for me.
(Fix:
https://github.com/django/django/commit/4f5526e346861c0b2ffa2ea7229747c883e14432)

I changed the file in django/core/management/commands/makemessages.py
{{{
# django/core/management/commands/makemessages.py, line 193
with open(potfile, 'a', encoding='utf-8', newline='\n') as fp:
}}}

from newline="\n" to newline="\r" and it works.

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

Django

unread,
Jan 25, 2018, 7:42:10 AM1/25/18
to django-...@googlegroups.com
#29061: manage.py makemessages throws syntax error due to incorrectly generated
django.pot, again
-------------------------------------+-------------------------------------
Reporter: Kyan | Owner: nobody
Type: Bug | Status: new
Component: Core (Management | Version: 2.0
commands) |
Severity: Normal | Resolution:
Keywords: gettext, | Triage Stage:
makemessages, Windows | Unreviewed
Has patch: 0 | Needs documentation: 0

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

* Attachment "201703271529397914076.png" added.

first makemessages is for "\r" version, second makemessages is for "\n"
version.

Django

unread,
Feb 3, 2018, 6:11:01 PM2/3/18
to django-...@googlegroups.com
#29061: manage.py makemessages throws syntax error due to incorrectly generated
django.pot, again
-------------------------------------+-------------------------------------
Reporter: Kyan | Owner: nobody
Type: Bug | Status: new
Component: Core (Management | Version: 2.0
commands) |
Severity: Normal | Resolution:
Keywords: gettext, | Triage Stage: Accepted
makemessages, Windows |
Has patch: 0 | Needs documentation: 0

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

* stage: Unreviewed => Accepted


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

Django

unread,
Jan 21, 2019, 1:19:09 PM1/21/19
to django-...@googlegroups.com
#29061: manage.py makemessages throws syntax error due to incorrectly generated
django.pot, again
-------------------------------------+-------------------------------------
Reporter: Kyan | Owner: Gurpreet
| Singh
Type: Bug | Status: assigned

Component: Core (Management | Version: 2.0
commands) |
Severity: Normal | Resolution:
Keywords: gettext, | Triage Stage: Accepted
makemessages, Windows |
Has patch: 0 | Needs documentation: 0

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

* status: new => assigned
* owner: nobody => Gurpreet Singh


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

Django

unread,
Jul 16, 2023, 2:14:42 PM7/16/23
to django-...@googlegroups.com
#29061: manage.py makemessages throws syntax error due to incorrectly generated
django.pot, again
-------------------------------------+-------------------------------------
Reporter: Kyan | Owner: Anvansh

| Singh
Type: Bug | Status: assigned
Component: Core (Management | Version: 2.0
commands) |
Severity: Normal | Resolution:
Keywords: gettext, | Triage Stage: Accepted
makemessages, Windows |
Has patch: 0 | Needs documentation: 0

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

* owner: nobody => Anvansh Singh


* status: new => assigned

Django

unread,
Jul 17, 2023, 3:44:03 PM7/17/23
to django-...@googlegroups.com
#29061: manage.py makemessages throws syntax error due to incorrectly generated
django.pot, again
-------------------------------------+-------------------------------------
Reporter: Kyan | Owner: Anvansh
| Singh
Type: Bug | Status: assigned
Component: Core (Management | Version: 2.0
commands) |
Severity: Normal | Resolution:
Keywords: gettext, | Triage Stage: Accepted
makemessages, Windows |
Has patch: 0 | Needs documentation: 0

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

Comment (by Anvansh Singh):

I am a bit unsure what would be the best place to add the regression test
for it. Can really use some help with that.

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

Django

unread,
Aug 7, 2023, 10:02:20 AM8/7/23
to django-...@googlegroups.com
#29061: manage.py makemessages throws syntax error due to incorrectly generated
django.pot, again
-------------------------------------+-------------------------------------
Reporter: Kyan | Owner: Anvansh
| Singh
Type: Bug | Status: assigned
Component: Core (Management | Version: 2.0
commands) |
Severity: Normal | Resolution:
Keywords: gettext, | Triage Stage: Accepted
makemessages, Windows |
Has patch: 0 | Needs documentation: 0

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

Comment (by Sarah Boyce):

Sorry for not looking into this in more detail. I made what I was
expecting a regression test might look like
https://github.com/django/django/pull/17150/ but it seems to be passing
everywhere.
In the commit comment they mention that their system is Win10 with gettext
0.19.8.1. The image attached in the ticket doesn't look to be related.
I could be getting a lot of things wrong here, I may have misunderstood
the ticket, or it is already fixed, or this is related to a very specific
setup that is not covered by the GitHub actions, or the ticket is not
valid.

I will try to get someone who is more familiar with translations to double
check the ticket and point us in the right direction here 👍

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

Django

unread,
Aug 7, 2023, 10:32:24 AM8/7/23
to django-...@googlegroups.com
#29061: manage.py makemessages throws syntax error due to incorrectly generated
django.pot, again
-------------------------------------+-------------------------------------
Reporter: Kyan | Owner: Anvansh
| Singh
Type: Bug | Status: assigned
Component: Core (Management | Version: 2.0
commands) |
Severity: Normal | Resolution:
Keywords: gettext, | Triage Stage: Accepted
makemessages, Windows |
Has patch: 0 | Needs documentation: 0

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

* cc: Claude Paroz (added)


Comment:

Claude - I hear you're the translations expert 🎉 no rush on this one,
when you get some time can you check if you think this ticket is valid and
how we can replicate the issue?

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

Django

unread,
Aug 8, 2023, 12:01:32 PM8/8/23
to django-...@googlegroups.com
#29061: manage.py makemessages throws syntax error due to incorrectly generated
django.pot, again
-------------------------------------+-------------------------------------
Reporter: Kyan | Owner: Anvansh
| Singh
Type: Bug | Status: assigned
Component: Core (Management | Version: 2.0
commands) |
Severity: Normal | Resolution:
Keywords: gettext, | Triage Stage: Accepted
makemessages, Windows |
Has patch: 0 | Needs documentation: 0

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

Comment (by Claude Paroz):

I must admit I don't have any motivation to fix Windows-related issue, and
even if I had, having no access to a Windows system is crippling to fix
such issues. Sorry.

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

Django

unread,
Aug 8, 2023, 1:36:06 PM8/8/23
to django-...@googlegroups.com
#29061: manage.py makemessages throws syntax error due to incorrectly generated
django.pot, again
-------------------------------------+-------------------------------------
Reporter: Kyan | Owner: Anvansh
| Singh
Type: Bug | Status: assigned
Component: Core (Management | Version: 2.0
commands) |
Severity: Normal | Resolution:
Keywords: gettext, | Triage Stage: Accepted
makemessages, Windows |
Has patch: 0 | Needs documentation: 0

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

Comment (by Sarah Boyce):

That's completely fine! I sank some time trying to install gettext on our
Windows GitHub action and found the whole thing very frustrating - thank
you for getting to me ⭐

--
Ticket URL: <https://code.djangoproject.com/ticket/29061#comment:7>

Django

unread,
Aug 8, 2023, 5:20:50 PM8/8/23
to django-...@googlegroups.com
#29061: manage.py makemessages throws syntax error due to incorrectly generated
django.pot, again
-------------------------------------+-------------------------------------
Reporter: Kyan | Owner: Sarah
| Boyce

Type: Bug | Status: assigned
Component: Core (Management | Version: 2.0
commands) |
Severity: Normal | Resolution:
Keywords: gettext, | Triage Stage: Accepted
makemessages, Windows |
Has patch: 1 | Needs documentation: 0

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

* owner: Anvansh Singh => Sarah Boyce
* has_patch: 0 => 1


Comment:

Ok so managed to get a version of gettext installed in our GitHub action
by installing poedit (via chocolatey
https://community.chocolatey.org/packages/poedit) which has gettext
bundled. Then I have a test as to my best guess of what the issue might be
referring to and this passes.

Going to mark the ticket for a PR review but I think the PR is optional, I
am very tempted to close the ticket as "worksforme" but I will let a
merger decide what's most appropriate.

--
Ticket URL: <https://code.djangoproject.com/ticket/29061#comment:8>

Django

unread,
Aug 10, 2023, 2:31:07 AM8/10/23
to django-...@googlegroups.com
#29061: manage.py makemessages throws syntax error due to incorrectly generated
django.pot, again
-------------------------------------+-------------------------------------
Reporter: Kyan | Owner: Sarah
| Boyce
Type: Bug | Status: closed

Component: Core (Management | Version: 2.0
commands) | Resolution:
Severity: Normal | worksforme

Keywords: gettext, | Triage Stage:
makemessages, Windows | Unreviewed
Has patch: 0 | Needs documentation: 0

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

* status: assigned => closed
* has_patch: 1 => 0
* resolution: => worksforme
* stage: Accepted => Unreviewed


Comment:

Replying to [comment:8 Sarah Boyce]:


> Ok so managed to get a version of gettext installed in our GitHub action
by installing poedit (via chocolatey
https://community.chocolatey.org/packages/poedit) which has gettext
bundled. Then I have a test as to my best guess of what the issue might be
referring to and this passes.

Thanks for all your efforts and investigation.

> Going to mark the ticket for a PR review but I think the PR is optional,
I am very tempted to close the ticket as "worksforme" but I will let a
merger decide what's most appropriate.

Agreed, we've not changed anything in Django itself, so it's not worth
extra testing and workarounds.

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

Reply all
Reply to author
Forward
0 new messages