summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2017-11-24 14:47:19 +0100
committerClaude Paroz <claude@2xlibre.net>2017-11-28 08:52:37 +0100
commit4f5526e346861c0b2ffa2ea7229747c883e14432 (patch)
tree5beae718968e353467131d6b7230b75f54b9c2ae
parent616f468760e4984915bb2ccca6b9eb3d80ddadb0 (diff)
Fixed #28773 -- Forced pot files to use UNIX-style newlines
Thanks Hendy Irawan for the analysis and report.
-rw-r--r--django/core/management/commands/makemessages.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/django/core/management/commands/makemessages.py b/django/core/management/commands/makemessages.py
index f8c0da8388..fefa8ef3b0 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)