# HG changeset patch # User Matt Harbison # Date 2022-11-04 21:54:43 # Node ID 2506c3ac73f40d66472882e509d363eeb5f1aaed # Parent cc9a60050a07aa675a837caf210ce8d77d96cb07 vfs: make the default opener mode binary The default was already binary for `abstractvfs`, and the `vfs` implementation adds binary mode if the caller didn't supply it. Therefore, it should be safe for all vfs objects (and I don't think we want text reads anyway). diff --git a/mercurial/vfs.py b/mercurial/vfs.py --- a/mercurial/vfs.py +++ b/mercurial/vfs.py @@ -425,7 +425,7 @@ class vfs(abstractvfs): def __call__( self, path: bytes, - mode: bytes = b"r", + mode: bytes = b"rb", atomictemp=False, notindexed=False, backgroundclose=False, @@ -612,7 +612,7 @@ class readonlyvfs(proxyvfs): def __init__(self, vfs: "vfs"): proxyvfs.__init__(self, vfs) - def __call__(self, path: bytes, mode: bytes = b'r', *args, **kw): + def __call__(self, path: bytes, mode: bytes = b'rb', *args, **kw): if mode not in (b'r', b'rb'): raise error.Abort(_(b'this vfs is read only')) return self.vfs(path, mode, *args, **kw)