[Python-checkins] cpython: #22731 test_capi test fails because of mismatched newlines

steve.dower python-checkins at python.org
Sat Nov 1 23:11:38 CET 2014


https://hg.python.org/cpython/rev/edb270e5c9c3
changeset:   93335:edb270e5c9c3
user:        Steve Dower <steve.dower at microsoft.com>
date:        Sat Nov 01 15:11:05 2014 -0700
summary:
  #22731 test_capi test fails because of mismatched newlines

files:
  Lib/test/test_capi.py |  7 ++++---
  1 files changed, 4 insertions(+), 3 deletions(-)


diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py
--- a/Lib/test/test_capi.py
+++ b/Lib/test/test_capi.py
@@ -304,12 +304,13 @@
         cmd.extend(args)
         p = subprocess.Popen(cmd,
                              stdout=subprocess.PIPE,
-                             stderr=subprocess.PIPE)
+                             stderr=subprocess.PIPE,
+                             universal_newlines=True)
         (out, err) = p.communicate()
         self.assertEqual(p.returncode, 0,
                          "bad returncode %d, stderr is %r" %
                          (p.returncode, err))
-        return out.decode("latin1"), err.decode("latin1")
+        return out, err
 
     def test_subinterps(self):
         # This is just a "don't crash" test
@@ -339,7 +340,7 @@
         expected_errors = sys.__stdout__.errors
         expected_stdin_encoding = sys.__stdin__.encoding
         expected_pipe_encoding = self._get_default_pipe_encoding()
-        expected_output = os.linesep.join([
+        expected_output = '\n'.join([
         "--- Use defaults ---",
         "Expected encoding: default",
         "Expected errors: default",

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list