fix: replace deprecated locale.getdefaultlocale() with getlocale()#699
fix: replace deprecated locale.getdefaultlocale() with getlocale()#699No-22-Github wants to merge 3 commits intoAkegarasu:mainfrom
Conversation
|
getlocale cant be simply replaced |
|
Thank you for pointing this out. I mistakenly assumed that getlocale() could be used as a direct replacement for getdefaultlocale(), without fully considering the behavioral and structural differences between the two. I’ll carefully review the relevant code and revise the implementation accordingly. I’ll submit a new PR once I’ve addressed the issue properly. I still have much to learn—thank you for your patience and guidance. |
|
I've updated the implementation of get_locale_compat() to better handle systems without locale-related environment variables, such as Windows. It now falls back to locale.getlocale() when necessary, which allows it to correctly detect Chinese locale on Windows systems as well. Please kindly review the updated changes when you have time. Thank you again for your detailed feedback. |
Although Python 3.11 still supports locale.getdefaultlocale(), it is deprecated and will be removed in Python 3.15+. This change avoids the warning and improves forward compatibility.