Re:Mercurial’s journey to and reflections on Python 3
by takeda on Tuesday January 14, 2020 @01:03AM
(#22042259)
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.
[ Parent
| on HN ]
Re:Mercurial’s journey to and reflections on Python 3
by masklinn on Tuesday January 14, 2020 @01:15AM
(#22042307)
> 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.