4 ms·
The locales are provided by LANG and other locate variables, so Python will use whatever is set in environment, you can also specify the encoding in one of open
by takeda 7y ago
The locales are provided by LANG and other locate variables, so Python will use whatever is set in environment, you can also specify the encoding in one of open() parameters.
- masklinn 7y ago> The locales are provided by LANG and other locate variables Which is absolutely not what you want when, say, opening your own data files. Even when opening the user’s files it’s likely not what you want. > you can also specify … And what I’m saying is this is not a “can also” it’s a “must”. Not doing so will bite you in the ass, because “whatever random garbage is on the machine” is really not what you want a default to be.
- takeda 7y agoOh I see your point. Looks like they changed the behavior in 3.7 (they added -X UTF-8 option), but being able to set it from the application would be great.