D2297: py3: backout 7c54917b31f6 to make sure second argument of open() is str

Yuya Nishihara yuya at tcha.org
Thu Feb 22 10:49:00 EST 2018


"There are around 100 occurences of open() call, it's better if we can
prevent replacing all these calls
"In future, when we will dropping all the compatibility code, we don't have
to take care of changing pycompat.open back to open

Yeah, that's the point why we have `from pycompat import open` to compensate
the mess introduced by our code transformer. We want to keep 'rb' without b''.
We could do that by the transformer, but I think it's better to keep the
transformer less complicated.

FWIW, we'll need to port many of these 100 open() calls to vfs. I have vague
memory that Python 3.5 or 3.6 introduced another mess on Windows I/O around
ANSI vs Unicode.


More information about the Mercurial-devel mailing list