# HG changeset patch # User Yuya Nishihara # Date 1520205676 18000 # Node ID 1fbbb8e83392ac026f67503956fb70a1bb6f515d # Parent 86ba6e3eba4e0f286eeb2b6eea43a3812a199a80 py3: read/write plain lock file in binary mode A lock file shouldn't contain '\n', so this isn't a BC. diff -r 86ba6e3eba4e -r 1fbbb8e83392 contrib/python3-whitelist --- a/contrib/python3-whitelist Mon Mar 05 12:31:08 2018 -0500 +++ b/contrib/python3-whitelist Sun Mar 04 18:21:16 2018 -0500 @@ -373,6 +373,7 @@ test-subrepo.t test-symlinks.t test-tag.t +test-tags.t test-treemanifest.t test-unamend.t test-uncommit.t diff -r 86ba6e3eba4e -r 1fbbb8e83392 mercurial/util.py --- a/mercurial/util.py Mon Mar 05 12:31:08 2018 -0500 +++ b/mercurial/util.py Sun Mar 04 18:21:16 2018 -0500 @@ -1685,7 +1685,8 @@ except AttributeError: # no symlink in os pass - ld = os.open(pathname, os.O_CREAT | os.O_WRONLY | os.O_EXCL) + flags = os.O_CREAT | os.O_WRONLY | os.O_EXCL | getattr(os, 'O_BINARY', 0) + ld = os.open(pathname, flags) os.write(ld, info) os.close(ld) @@ -1697,7 +1698,7 @@ raise except AttributeError: # no symlink in os pass - fp = posixfile(pathname) + fp = posixfile(pathname, 'rb') r = fp.read() fp.close() return r