# HG changeset patch # User Matt Harbison # Date 2024-12-05 02:09:12 # Node ID 00f5966f0483a21e34174db7b003302f6403b0aa # Parent 535a1e686d7f6425015f9611a5a3f0f8d7ecefea cmdutil: stop using the `pycompat.open()` shim Somewhat dubious I suppose, but maybe it makes sense to use the type checking system to more aggressively use str for trivial things like the `mode` argument to the function that calls this. That's a project for another day. diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -30,9 +30,6 @@ from .node import ( nullrev, short, ) -from .pycompat import ( - open, -) from .thirdparty import attr # Force pytype to use the non-vendored package @@ -1406,7 +1403,7 @@ def makefileobj(ctx, pat, mode=b'wb', ** 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):