mercurial/cmdutil.py
changeset 52370 00f5966f0483
parent 51859 f4733654f144
child 52452 9d79ffeed7c0
--- a/mercurial/cmdutil.py	Wed Dec 04 21:05:33 2024 -0500
+++ b/mercurial/cmdutil.py	Wed Dec 04 21:09:12 2024 -0500
@@ -30,9 +30,6 @@
     nullrev,
     short,
 )
-from .pycompat import (
-    open,
-)
 from .thirdparty import attr
 
 # Force pytype to use the non-vendored package
@@ -1406,7 +1403,7 @@
             fp = repo.ui.fin
         return _unclosablefile(fp)
     fn = makefilename(ctx, pat, **props)
-    return open(fn, mode)
+    return open(fn, pycompat.sysstr(mode))
 
 
 def openstorage(repo, cmd, file_, opts, returnrevlog=False):