makemessages creates broken .po files since r12296 when updating them under Windows
|Reported by:||ramiro||Owned by:||nobody|
|Has patch:||no||Needs documentation:|
|Needs tests:||Patch needs improvement:|
In r12296 a migration from os.popen3() to subprocess.Popen() to drop Python 2.3 constructs was implemented.
Unfortunately this broke the updating (creating new files isn't affected) of message files because the files obtained don't have the standard format (This has been always a tricky area; we added a mode 't' argument to the popen3() calls back in r8576 to solve this kind of problems.)
An example of the Django own django.po when updating them with django-admin.py makemessages under such platform:
.po file header snipped "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: .\conf\global_settings.py:44 msgid "Arabic" msgstr "árabe" #: .\conf\global_settings.py:45 msgid "Bulgarian" msgstr "búlgaro" #: .\conf\global_settings.py:46 msgid "Bengali" msgstr "bengalí" #: .\conf\global_settings.py:47 #, fuzzy msgid "Bosnian" msgstr "estonio" #: .\conf\global_settings.py:48 msgid "Catalan" msgstr "catalán"
Note the extra empty lines between the location comments line and the msgid or flags line (it is actually caused by a mix of \r and \r\n sequences.)
This issue is fixed by the patch attached to #11869.