#26341 closed Bug (fixed)
Weird comments in PO files (.html.py filenames)
Reported by: | Sylvain Garancher | Owned by: | Veranika |
---|---|---|---|
Component: | Internationalization | Version: | 1.9 |
Severity: | Normal | Keywords: | |
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
I just upgraded Django to 1.9.4 from 1.8.10, and sometimes, the filenames in PO files comments contain ".html.py" extensions.
This is visible on django's main repository :
https://github.com/django/django/blob/ae4d932b1ac12651a7c57d89742c25483ee8c9f9/django/contrib/admin/locale/en/LC_MESSAGES/django.po#L282
https://github.com/django/django/blob/4323676ea5ab6994feb1385522665069d84f397b/django/contrib/admin/locale/en/LC_MESSAGES/django.po#L302
In this example, the "contrib/admin/templates/admin/base_site.html" file is now named "contrib/admin/templates/admin/base_site.html.py" (with a trailing ".py") in the po file.
This seems to appear only on lines with a python file before the template html file.
claudep found that this could be the faulty commit : https://github.com/django/django/commit/e75882332c
Change History (15)
comment:1 by , 9 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:3 by , 9 years ago
Has patch: | set |
---|---|
Owner: | changed from | to
comment:4 by , 9 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
Left a few cosmetic comments. Claude, could you check it too?
comment:5 by , 9 years ago
Patch needs improvement: | set |
---|---|
Triage Stage: | Ready for checkin → Accepted |
There's a test failure in the latest iteration of the patch.
comment:7 by , 9 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:8 by , 9 years ago
Should I backport to 1.9?
The note could be: Fixed a
makemessages
regression where temporary
.py
extensions were leaked in source file paths (:ticket:
26341).
We used to create messages file by file, and then we could make a simple replace to remove that temporary
.py
extension. Now that we are calling gettext for a bunch of files, some source comments might contain more than one source on a single line. The replacement algorithm inpostprocess_messages
of the makemessages command doesn't catch those occurrences.