> Python guesses the system encoding using logic that looks at the locale environment variables
This is not an implementation detail, but means that when Python chooses a different encoding than you thought, your program crashes spectacularly (and not on start, but on some unicode operation further down the line).
The same program will run differently depending on who starts it. This should go on top on all Python 3 tutorials, since it's not obvious at all what happened, especially not for a beginner. Non-conformant environment variables and file names causes all sorts of weird problems.
I can recommend Armin Ronacher's unicode tutorials for Python 3. It is what saved my sanity when I first encountered it.
...your program crashes spectacularly (and not on start, but on some unicode operation further down the line).
ISTM that it could be a good idea to try all potentially-dangerous unicode-related operations immediately on startup. That might be a good idea for a package or even an addition to the stdlib.
This is not an implementation detail, but means that when Python chooses a different encoding than you thought, your program crashes spectacularly (and not on start, but on some unicode operation further down the line).
The same program will run differently depending on who starts it. This should go on top on all Python 3 tutorials, since it's not obvious at all what happened, especially not for a beginner. Non-conformant environment variables and file names causes all sorts of weird problems.
I can recommend Armin Ronacher's unicode tutorials for Python 3. It is what saved my sanity when I first encountered it.