diff options
| author | Claude Paroz <claude@2xlibre.net> | 2017-11-24 14:47:19 +0100 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2017-11-28 08:54:06 +0100 |
| commit | aba31aa86b0d4bcdede1034cade0e2054d6b4a5d (patch) | |
| tree | 748f271302817e960207fbe8f0bd9732818dfd40 | |
| parent | 75c1fd653858997449f7ac47a3f3379723bbfc73 (diff) | |
[2.0.x] Fixed #28773 -- Forced pot files to use UNIX-style newlines
Thanks Hendy Irawan for the analysis and report.
Backport of 4f5526e346861c0b2ffa2ea7229747c883e14432 from master.
| -rw-r--r-- | django/core/management/commands/makemessages.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/django/core/management/commands/makemessages.py b/django/core/management/commands/makemessages.py index 0151644a3a..cb4d0ad240 100644 --- a/django/core/management/commands/makemessages.py +++ b/django/core/management/commands/makemessages.py @@ -188,7 +188,9 @@ def write_pot_file(potfile, msgs): header_read = True lines.append(line) msgs = '\n'.join(lines) - with open(potfile, 'a', encoding='utf-8') as fp: + # Force newlines of POT files to '\n' to work around + # https://savannah.gnu.org/bugs/index.php?52395 + with open(potfile, 'a', encoding='utf-8', newline='\n') as fp: fp.write(msgs) |
