D7517: filemerge: byteify the open() mode
mharbison72 (Matt Harbison)
phabricator at mercurial-scm.org
Wed Dec 11 17:58:57 EST 2019
mharbison72 added a comment.
In D7517#111885 <https://phab.mercurial-scm.org/D7517#111885>, @durin42 wrote:
> I'm a little fuzzy on this: should I see some test failures? or...?
It looks like not. I glossed over the fact that `pycompat.sysstr()` will simply return `str` if given one, before trying to decode it. So it will take either `bytes` or `str`.
I looks like the VSCode complaint about passing bytes as the mode is only flagged when used in a context manager (several lines below), even though clicking through to the definition brings it to pycompat. I don't remember if this particular thing was flagged by static analysis, or it just caught my eye because 99% of the modes in other uses (outside tests/, contrib/ and setup.py) are bytes. But the latest version of PyCharm isn't complaining, nor is pytype. So I can abandon it if you'd prefer.
CHANGES SINCE LAST ACTION
To: mharbison72, #hg-reviewers
Cc: durin42, dlax, mercurial-devel
More information about the Mercurial-devel