From af8ac46015f5bbed7c266df0ff8490e05282ab59 Mon Sep 17 00:00:00 2001
From: Ramiro Morales <cramm0@gmail.com>
Date: Sat, 28 May 2016 19:17:48 -0300
Subject: [PATCH] [1.10.x] Fixed #26674 -- Corrected a i18n makemessages test.

Made it consistently read the PO file, decode its contents and then
check for the non-breaking space Unicode code point.

Previously we were erroneously skipping the interpretation of what we
read as UTF-8 text.

This was causing the test to fail on Windows with Python 3.5.

Backport of 1b00ed088073ffd268af15d25246d2565253536d from master
---
 tests/i18n/test_extraction.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/i18n/test_extraction.py b/tests/i18n/test_extraction.py
index 83fbeb5bd48..2c7e7ea6d05 100644
--- a/tests/i18n/test_extraction.py
+++ b/tests/i18n/test_extraction.py
@@ -214,9 +214,9 @@ class BasicExtractorTests(ExtractorTests):
         os.chdir(self.test_dir)
         management.call_command('makemessages', locale=[LOCALE], verbosity=0)
         self.assertTrue(os.path.exists(self.PO_FILE))
-        with open(self.PO_FILE, 'r') as fp:
-            po_contents = force_text(fp.read())
-            self.assertMsgId("Non-breaking space\xa0:", po_contents)
+        with io.open(self.PO_FILE, 'r', encoding='utf-8') as fp:
+            po_contents = fp.read()
+            self.assertMsgId("Non-breaking space\u00a0:", po_contents)
 
     def test_blocktrans_trimmed(self):
         os.chdir(self.test_dir)