Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.1k
Closed
Description
Bug report
When callinglocale.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 versionlocale.getencoding()
is callinglocale.getdefaultlocale()
https://github.com/python/cpython/blob/v3.12.0a5/Lib/locale.py#L642
andlocale.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