@ashwinvis @feoh Correct. But this is not the case throughout the standard library; for instance, dbm can't open that file. Can't fit it all in a toot. I wrote about it with more nuance at https://changelog.complete.org/archives/10063-the-fundamental-problem-in-python-3 and https://changelog.complete.org/archives/10053-the-incredible-disaster-of-python-3 . In short, I don't think #Python 3 is suitable for systems or scripting work anymore. It is too dang hard to just handle filenames correctly.
@jgoerzen @ashwinvis What do you propose instead? To be honest I've never encountered anything but ASCII filenames in all my years of infrastructure work. Obviously full unicode support is important but nowhere near enough to disqualify a language in very wide use that clearly works very well for a whole lot of people.
@feoh @ashwinvis I guess the alternative depends on the needs. I'm sure Pythong is still suitable for some things. But the problem here isn't that it can't handle Unicode; it's that it can't handle non-Unicode very well, and this sets it up for bugs and issues in a lot of scenarios. So for instance, I have Gopher mirrors from the 90s, before Unicode, and there are many filenames that are in ISO-8859-1 or similar that are a real mess in Python 3
@jgoerzen @ashwinvis OK. So it's not good for your use case. That's cool. I can totally buy that, but there is a HUGE different between saying "Python 3 no longer works for my use case" and "Python 3 isn't suitable for systems and scripting work anymore" when the BigCo I work for churns out literally thousands of lines a day in mission critical systems.
So bash has a lot of similar (or worse) bugs handling filenames. People still use it. It does have workarounds, though you have to know how to use them carefully.
Python 3 doesn't even have workarounds in many places. Do you want something that will crash if \xF7 is in a filename? That's just not robust coding practices. You've got to handle the unexpected-but-valid. And it's HARD in python 3.
@feoh @ashwinvis For personal projects, it's bash for simpler things and #Rust for more complicated ones. Sometimes #Haskell. Yeah, I know, Rust is compiled and Haskell also (usually) is, but both have type inference and don't require a lot of verbosity to use. I am a strong believer in correctness and often need it in my scripts, so having the robust type checking & error system in Rust is perfect for a lot of that. (I also rigorously use set -e and pipefail in bash)
For people who care about, support, or build Free, Libre, and Open Source Software (FLOSS).