From c8fc53b4c0dc0c37fc810aa0f0495a97fc88dba9 Mon Sep 17 00:00:00 2001 From: Jane Doe Date: Sat, 27 May 2017 17:43:03 -0700 Subject: py2/3 in test.read, if using py3 and not binary, then allow specifying what to do with newline. PY3 will automatically translate it which can yield \r\r\n's in files --- QMTest/TestCmd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'QMTest') diff --git a/QMTest/TestCmd.py b/QMTest/TestCmd.py index cc8e69a1..aec51d0a 100644 --- a/QMTest/TestCmd.py +++ b/QMTest/TestCmd.py @@ -1245,7 +1245,7 @@ class TestCmd(object): file = self.canonicalize(file) if mode[0] != 'r': raise ValueError("mode must begin with 'r'") - if PY3: + if PY3 and 'b' not in mode: return open(file, mode, newline=newline).read() else: return open(file, mode).read() -- cgit v1.2.1