Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

locale.getdefaultlocale is depreciated and will be removed in 3.15 #23318

Open
athompson673 opened this issue Dec 19, 2024 · 0 comments
Open

Comments

@athompson673
Copy link
Contributor

Problem Description

Use of depreciated locale.getdefaultlocale

I'm not sure how to best replace this with getlocale() as suggested by the warning message, as the output of the two is slightly different (on my machine)

IPython 8.29.0 -- An enhanced Interactive Python. Type '?' for help.

import locale

locale.getlocale()
Out[2]: ('English_United States', '1252')

locale.getdefaultlocale()
C:\Users\acthomp4\AppData\Local\Temp\1\ipykernel_3168\793819832.py:1: DeprecationWarning: 'locale.getdefaultlocale' is deprecated and slated for removal in Python 3.15. Use setlocale(), getencoding() and getlocale() instead.
  locale.getdefaultlocale()
Out[3]: ('en_US', 'cp1252')

What steps reproduce the problem?

Warning generated while running pytest on spyder test suite

Paste Traceback/Error Below (if applicable)

spyder\config\base.py:441: DeprecationWarning: 'locale.getdefaultlocale' is deprecated and slated for removal in Python 3.15. Use setlocale(), getencoding() and getlocale() instead.
    locale_language = locale.getdefaultlocale()[0]

Versions

  • Spyder version: 6.1.0a1.dev0 (pip)
  • Python version: 3.12.7 64-bit
  • Qt version: 5.15.2
  • PyQt5 version: 5.15.11
  • Operating System: Windows-10-10.0.19045-SP0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant