From 4f5526e346861c0b2ffa2ea7229747c883e14432 Mon Sep 17 00:00:00 2001
From: Claude Paroz <claude@2xlibre.net>
Date: Fri, 24 Nov 2017 14:47:19 +0100
Subject: [PATCH] Fixed #28773 -- Forced pot files to use UNIX-style newlines

Thanks Hendy Irawan for the analysis and report.
---
 django/core/management/commands/makemessages.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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)