diff -r 1527f40de3b3 -r 5bc7ff103081 mercurial/patch.py --- a/mercurial/patch.py Sat Mar 10 15:50:09 2018 +0900 +++ b/mercurial/patch.py Sat Mar 10 15:57:16 2018 +0900 @@ -216,7 +216,7 @@ data = {} fd, tmpname = tempfile.mkstemp(prefix='hg-patch-') - tmpfp = os.fdopen(fd, pycompat.sysstr('wb')) + tmpfp = os.fdopen(fd, r'wb') try: msg = pycompat.emailparser().parse(fileobj) @@ -1106,7 +1106,7 @@ ncpatchfp = None try: # Write the initial patch - f = os.fdopen(patchfd, pycompat.sysstr("w")) + f = os.fdopen(patchfd, r"w") chunk.header.write(f) chunk.write(f) f.write('\n'.join(['# ' + i for i in phelp.splitlines()]))