taichi-dev / taichi

Productive, portable, and performant GPU programming in Python.
https://taichi-lang.org
Apache License 2.0
25.54k stars 2.29k forks source link

[Misc] Replace deprecated locale.getdefaultlocale() in diagnose.py #8598

Open bluevisor opened 1 week ago

bluevisor commented 1 week ago

Brief Summary

This PR addresses a DeprecationWarning in diagnose.py related to the use of locale.getdefaultlocale(), which is deprecated as of Python 3.15. The warning was as follows:

DeprecationWarning: ‘locale.getdefaultlocale’ is deprecated and slated for removal in Python 3.15. Use setlocale(), getencoding() and getlocale() instead.

Changes Made

Rationale

This change future-proofs the code by using recommended functions (getlocale() and getpreferredencoding()), ensuring compatibility with Python 3.15 and beyond.

Testing