Re:Mercurial’s journey to and reflections on Python 3
by lmm on Monday January 13, 2020 @07:10PM
(#22040279)
The point is that filenames aren't bytestreams on windows, and if you treat them as such then your program won't work.
[ Parent
| on HN ]
Re:Mercurial’s journey to and reflections on Python 3
by WorldMaker on Monday January 13, 2020 @07:58PM
(#22040670)
By this point, any cross-platform file tool that isn't using Unicode as a lowest-common denominator for filenames and similar things to insure maximal compatibility is likely ready to cause havoc.
(The remarks in the post here that Mercurial on Python 3 on Windows is not yet stable and showing a lot of issues is possibly even an indicator/canary here. To my understanding, Python 2 Windows used to paper over some of these lowest common denominator encoding compatibility issues with a lot more handholding than they do with the Python 3 Unicode assumption.)
Re:Mercurial’s journey to and reflections on Python 3
by lmm on Monday January 13, 2020 @09:12PM
(#22041173)
> By this point, any cross-platform file tool that isn't using Unicode as a lowest-common denominator for filenames and similar things to insure maximal compatibility is likely ready to cause havoc.
Be that as it may, Mercurial has existing repositories that may use non-unicode filenames, and just crashing whenever you try to operate on them is probably not an acceptable way forward.
Re:Mercurial’s journey to and reflections on Python 3
by WorldMaker on Tuesday January 14, 2020 @02:39PM
(#22048434)
Sure, but that's also not the only resulting option; instead of erroring you could also do something nice like help those users migrate to cleaner Unicode encodings of their filenames by asking them to correct mistakes or provide information about the original encoding. It takes more code to do that than just throwing an error, of course, but who knows how many users that might help that don't even realize why their repositories don't work correctly on, say, Windows.
Re:Mercurial’s journey to and reflections on Python 3
by Dylan16807 on Tuesday January 14, 2020 @03:09AM
(#22042801)
Windows filenames basically are bytestreams. But the bytes come in pairs.
Re:Mercurial’s journey to and reflections on Python 3
by lmm on Wednesday January 15, 2020 @02:51AM
(#22052426)
Not really. Certain byte sequences are invalid.
Re:Mercurial’s journey to and reflections on Python 3
by Dylan16807 on Wednesday January 15, 2020 @03:14AM
(#22052514)
Certain byte sequences are invalid in unix filenames too. So that can't be the factor that decides if they are bytestreams or not.