# HG changeset patch # User Matt Harbison # Date 1581223195 18000 # Node ID 234001d22ba63f0057c630b20573adcab3c576ce # Parent 83b2b829c94ee984b95e34b4f38beb99b7f805e2 lfs: use str for the open() mode when opening a blob for py3 The other fix for this was to leave the mode as bytes, and import `pycompat.open()` like a bunch of other modules do. But I think it's confusing to still use bytes at the python boundary, and obviously error prone. Grepping for ` open\(.+, ['"][a-z]+['"]\)` and ` open\(.+, b['"][a-z]+['"]\)` outside of `tests`, there are 51 and 87 uses respectively, so it's not like this is a rare direct usage. Differential Revision: https://phab.mercurial-scm.org/D8099 diff -r 83b2b829c94e -r 234001d22ba6 hgext/lfs/blobstore.py --- a/hgext/lfs/blobstore.py Thu Jan 30 14:57:02 2020 +0100 +++ b/hgext/lfs/blobstore.py Sat Feb 08 23:39:55 2020 -0500 @@ -128,7 +128,7 @@ def open(self, oid): """Open a read-only file descriptor to the named blob, in either the usercache or the local store.""" - return open(self.path(oid), b'rb') + return open(self.path(oid), 'rb') def path(self, oid): """Build the path for the given blob ``oid``.