config: load included config files in binary mode
authorAugie Fackler <raf@durin42.com>
Fri, 03 Mar 2017 13:28:24 -0500
changeset 31154 fd3f4bf9325e
parent 31153 5cab44fd1257
child 31155 8266802f0fa4
config: load included config files in binary mode I guess we've been getting lucky that this works in Python 2. This fixes loading included config files in Python 3 (it used to fail on the "somebody set up us the BOM" check.)
mercurial/config.py
--- a/mercurial/config.py	Wed Mar 01 16:39:48 2017 -0800
+++ b/mercurial/config.py	Fri Mar 03 13:28:24 2017 -0500
@@ -169,5 +169,5 @@
 
     def read(self, path, fp=None, sections=None, remap=None):
         if not fp:
-            fp = util.posixfile(path)
+            fp = util.posixfile(path, 'rb')
         self.parse(path, fp.read(), sections, remap, self.read)