# HG changeset patch # User Augie Fackler # Date 2016-10-09 13:17:49 # Node ID 9df29b7c62cf361c87b3bc5e0cb547a694b35d6d # Parent 494d5cec0b07653a6b5daaaaec768dea92ffa987 ui: explicitly open config files in binary mode This has been working mostly accidentally, but now it works explicitly. diff --git a/mercurial/ui.py b/mercurial/ui.py --- a/mercurial/ui.py +++ b/mercurial/ui.py @@ -176,7 +176,7 @@ class ui(object): def readconfig(self, filename, root=None, trust=False, sections=None, remap=None): try: - fp = open(filename) + fp = open(filename, u'rb') except IOError: if not sections: # ignore unless we were looking for something return diff --git a/tests/test-check-py3-commands.t b/tests/test-check-py3-commands.t --- a/tests/test-check-py3-commands.t +++ b/tests/test-check-py3-commands.t @@ -9,6 +9,6 @@ The full traceback is hidden to have a s > $PYTHON3 `which hg` $cmd 2>&1 2>&1 | tail -1 > done version - TypeError: startswith first arg must be str or a tuple of str, not bytes + TypeError: cannot use a string pattern on a bytes-like object debuginstall - TypeError: startswith first arg must be str or a tuple of str, not bytes + TypeError: cannot use a string pattern on a bytes-like object