Patchwork [2,of,5] py3: add a missing b'' for Windows

login
register
mail settings
Submitter Matt Harbison
Date Sept. 19, 2018, 12:03 p.m.
Message ID <b99b91e41ae278b503c9.1537358634@Envy>
Download mbox | patch
Permalink /patch/34827/
State Accepted
Headers show

Comments

Matt Harbison - Sept. 19, 2018, 12:03 p.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1537324803 14400
#      Tue Sep 18 22:40:03 2018 -0400
# Node ID b99b91e41ae278b503c91895068cd10e0d0a429a
# Parent  6cf61fcd3fad06f14668a4cc56cc7c5351561219
py3: add a missing b'' for Windows

I tried ./contrib/byteify-strings.py, but there were way too many changes (and
most looked wrong).  This was hit with test-check-interfaces.py.

# skip-blame for b'' prefixes
Yuya Nishihara - Sept. 19, 2018, 1:09 p.m.
On Wed, 19 Sep 2018 08:03:54 -0400, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison@yahoo.com>
> # Date 1537324803 14400
> #      Tue Sep 18 22:40:03 2018 -0400
> # Node ID b99b91e41ae278b503c91895068cd10e0d0a429a
> # Parent  6cf61fcd3fad06f14668a4cc56cc7c5351561219
> py3: add a missing b'' for Windows
> 
> I tried ./contrib/byteify-strings.py, but there were way too many changes (and
> most looked wrong).  This was hit with test-check-interfaces.py.
> 
> # skip-blame for b'' prefixes
> 
> diff --git a/tests/run-tests.py b/tests/run-tests.py
> --- a/tests/run-tests.py
> +++ b/tests/run-tests.py
> @@ -1211,7 +1211,7 @@ class Test(unittest.TestCase):
>              output = re.sub(s, r, output)
>  
>          if normalizenewlines:
> -            output = output.replace('\r\n', '\n')
> +            output = output.replace(b'\r\n', b'\n')

Added one more b'' to the initial value of the output, and queued 2-5.
Many thanks.

Patch

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -1211,7 +1211,7 @@  class Test(unittest.TestCase):
             output = re.sub(s, r, output)
 
         if normalizenewlines:
-            output = output.replace('\r\n', '\n')
+            output = output.replace(b'\r\n', b'\n')
 
         return ret, output.splitlines(True)