3 ms·
Except the python3 str change was pretty big (and centered again, on those things that aren't just strings in POSIX). Getting the correct `bytes` that went in
by ElectricalUnion 3y ago
Except the python3 str change was pretty big (and centered again, on those things that aren't just strings in POSIX).
Getting the correct `bytes` that went in your program uses completly different interfaces compared normal python use , for example, you now need to use `os.environb` instead of `os.environ` if you want to use arbitrary POSIX-compliant `bytes` environment variables and `argvb = [os.fsencode(a) for a in sys.argv]` instead of just `argv` for POSIX-compliant `bytes` command line arguments.
As people suggest in https://peps.python.org/pep-0383/ https://peps.python.org/pep-0383/ , handling really arbitrary inputs is tough work.
- viraptor 3y agoPython 3 took about a decade to play out and for a few years you could opt to still explicitly use v2. Parent was saying those scripts "keep on breaking". Those two things are not the same.