Closed
Description
Bug report
When calling locale.getencoding()
while _locale.getencoding()
is not available, it shows looking-recursive deprecation warnings.
../Lib/locale.py:657: DeprecationWarning: Use setlocale(), getencoding() and getlocale() instead
This is happening because python version locale.getencoding()
is calling locale.getdefaultlocale()
https://github.com/python/cpython/blob/v3.12.0a5/Lib/locale.py#L642
and locale.getdefaultlocale
warns regardless where the call came from
https://github.com/python/cpython/blob/v3.12.0a5/Lib/locale.py#L544-L547
Your environment
- CPython versions tested on: v3.11.2 Lib with RustPython HEAD
- Operating system and architecture: aarch64-apple-darwin