3 ms·
Hum, any program that doesn't treat filenames as bytestreams on unix is broken. Doubly so if its primary purpose is preserving and archiving files. Are you su
by gpderetta 7y ago
Hum, any program that doesn't treat filenames as bytestreams on unix is broken. Doubly so if its primary purpose is preserving and archiving files.
Are you sure the issue wasn't something else?
- lmm 7y agoThe point is that filenames aren't bytestreams on windows, and if you treat them as such then your program won't work.
- WorldMaker 7y agoBy 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.)
- lmm 7y ago> 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.
- WorldMaker 7y agoSure, 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.
- Dylan16807 7y agoWindows filenames basically are bytestreams. But the bytes come in pairs.
- lmm 7y agoNot really. Certain byte sequences are invalid.
- Dylan16807 7y agoCertain byte sequences are invalid in unix filenames too. So that can't be the factor that decides if they are bytestreams or not.