Szorc: Mercurial's Journey to and Reflections on Python 3
Szorc: Mercurial's Journey to and Reflections on Python 3
Posted Jan 16, 2020 9:12 UTC (Thu) by nim-nim (subscriber, #34454)In reply to: Szorc: Mercurial's Journey to and Reflections on Python 3 by Cyberax
Parent article: Szorc: Mercurial's Journey to and Reflections on Python 3
Posted Jan 16, 2020 10:28 UTC (Thu)
by smurf (subscriber, #17840)
[Link] (4 responses)
The idea that file names are somehow privileged to not require that went out of the window a long time ago. It doesn't matter one whit whether the code printing said file name is written in Python, Rust, Go, C++, Z80 assembly, or LOLCODE.
If you want a standard way to carry non-UTF8 pseudo-printable data (e.g. Latin1 filenames from the stone ages), no problem, either use the surrogateescape method or do proper shell quoting. The "write the non-UTF8 data" method is fine only when limited to streams that are known to be binary. "find -print0" comes to mind.
Posted Jan 16, 2020 16:21 UTC (Thu)
by Cyberax (✭ supporter ✭, #52523)
[Link] (3 responses)
Posted Jan 16, 2020 17:43 UTC (Thu)
by smurf (subscriber, #17840)
[Link] (2 responses)
None of this is rocket science. Headers are supposed to be valid ASCII strings, after all, so why blame the people who try to adhere to the standard? Yes this could have been easier from the beginning, but that's why Python 3.8 is a whole lot better at this than 3.0.
Posted Jan 16, 2020 17:53 UTC (Thu)
by Cyberax (✭ supporter ✭, #52523)
[Link] (1 responses)
Posted Jan 17, 2020 6:11 UTC (Fri)
by smurf (subscriber, #17840)
[Link]
Szorc: Mercurial's Journey to and Reflections on Python 3
Szorc: Mercurial's Journey to and Reflections on Python 3
And what if you need to write a transparent proxy that needs to cope with non-UTF-8 headers?
Szorc: Mercurial's Journey to and Reflections on Python 3
Szorc: Mercurial's Journey to and Reflections on Python 3
The reality (that stubborn thing that doesn't go away) has agents that don't obey the standard. So a transparent proxy must accommodate it.
Szorc: Mercurial's Journey to and Reflections on Python 3