diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
index 0a12e5f3a979ee302dc10647483200df00a105ab_bWVyY3VyaWFsL3N1YnJlcG8ucHk=..ed1a212193dc237edc350330146128a13641e38f_bWVyY3VyaWFsL3N1YnJlcG8ucHk= 100644
--- a/mercurial/subrepo.py
+++ b/mercurial/subrepo.py
@@ -31,7 +31,7 @@
 def _calcfilehash(filename):
     data = ''
     if os.path.exists(filename):
-        fd = open(filename)
+        fd = open(filename, 'rb')
         data = fd.read()
         fd.close()
     return util.sha1(data).hexdigest()