Message415028
Currently, `encoding="locale"` is just shortcut of `encoding=locale.getpreferredencoding(False)`.
`encoding="locale"` means that "locale encoding should be used here, even if Python default encoding is changed to UTF-8".
I am not sure that UTF-8 mode becomes the default or not.
But some user want to use UTF-8 mode to change default encoding in their Python environments without waiting Python default encoding changed.
So I think `encoding="locale"` should use real locale encoding (ACP on Windows) regardless UTF-8 mode is enabled or not.
Currently, UTF-8 mode affects to `_Py_GetLocaleEncoding()`. So it is difficult that make encoding="locale" ignores UTF-8 mode.
Is it safe to use `locale.getlocale(locale.LC_CTYPE)[1] or "UTF-8"`? |
|
Date |
User |
Action |
Args |
2022-03-13 06:09:52 | methane | set | recipients:
+ methane, vstinner, ezio.melotti |
2022-03-13 06:09:52 | methane | set | messageid: <1647151792.05.0.892379342783.issue47000@roundup.psfhosted.org> |
2022-03-13 06:09:52 | methane | link | issue47000 messages |
2022-03-13 06:09:51 | methane | create | |
|