Patchwork [3,of,6] py3: add b'' to make a triple quoted string bytes on Python 3

login
register
mail settings
Submitter Pulkit Goyal
Date June 26, 2017, 1:24 p.m.
Message ID <ec85a665d187da18d585.1498483484@workspace>
Download mbox | patch
Permalink /patch/21732/
State Accepted
Headers show

Comments

Pulkit Goyal - June 26, 2017, 1:24 p.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1498314470 -19800
#      Sat Jun 24 19:57:50 2017 +0530
# Node ID ec85a665d187da18d585837150e4175ebb25e2ad
# Parent  00e3a9580558aed2243870567b89c0a6f5ba19b3
py3: add b'' to make a triple quoted string bytes on Python 3

Transformer does not adds b'' in front of triple quoted strings to prevent
converting docs to bytes.

Patch

diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -1168,7 +1168,7 @@ 
 
     return hardlink, num
 
-_winreservednames = '''con prn aux nul
+_winreservednames = b'''con prn aux nul
     com1 com2 com3 com4 com5 com6 com7 com8 com9
     lpt1 lpt2 lpt3 lpt4 lpt5 lpt6 lpt7 lpt8 lpt9'''.split()
 _winreservedchars = ':*?"<>|'