bpo-46659: Deprecate locale.getdefaultlocale() (GH-31206)

The locale.getdefaultlocale() function is deprecated and will be
removed in Python 3.13. Use locale.setlocale(),
locale.getpreferredencoding(False) and locale.getlocale() functions
instead.
This commit is contained in:
Victor Stinner 2022-02-22 22:06:43 +01:00 committed by GitHub
parent ccbe8045fa
commit b899126094
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 20 additions and 1 deletions

View file

@ -518,7 +518,8 @@ class TestMiscellaneous(unittest.TestCase):
os.environ['LC_CTYPE'] = 'UTF-8'
self.assertEqual(locale.getdefaultlocale(), (None, 'UTF-8'))
with check_warnings(('', DeprecationWarning)):
self.assertEqual(locale.getdefaultlocale(), (None, 'UTF-8'))
finally:
for k in orig_env: