You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
locale support including _locale and time.tzname #3850
Noticed quite a few functions in CPython Locale are not implemented in locale.rs. I don't have much experience with this type of work but would the general idea be to write a wrapper for say: GetLocaleIInfoA since it is used throughout CPython's implementation of getdefaultlocale so it can be used in our implementation?
You are on Windows right? I haven't looked into how CPython does it (am out atm) but if this is calling some os provided function then yes, we typically wrap it and call into it after converting the args.
The function to be wrapped should be in windows.rs?
Activity
bongjunj commentedon Nov 2, 2022
https://docs.python.org/3/library/time.html#time.tzname
The doc says
tznameis determined at module load time. Does "module load time" mean those values to be initialized in the function below?RustPython/vm/src/stdlib/time.rs
Lines 9 to 17 in 77b821a
bongjunj commentedon Nov 2, 2022
#4054
If we are talking about holding states such as
tzname(which is initialized at module load time), this can be related.youknowone commentedon Nov 5, 2022
It may not be exactly, but you can regard it is.
youknowone commentedon Nov 5, 2022
And yes. #4054 is generally related to module attributes and hidden data like Info types in sys module.
JazzGlobal commentedon Apr 18, 2023
Noticed quite a few functions in CPython Locale are not implemented in locale.rs. I don't have much experience with this type of work but would the general idea be to write a wrapper for say: GetLocaleIInfoA since it is used throughout CPython's implementation of
getdefaultlocaleso it can be used in our implementation?DimitrisJim commentedon Apr 18, 2023
You are on Windows right? I haven't looked into how CPython does it (am out atm) but if this is calling some os provided function then yes, we typically wrap it and call into it after converting the args.
The function to be wrapped should be in windows.rs?
JazzGlobal commentedon Apr 18, 2023
That's right, and gotcha. Looks like libc has bindings for
setlocalebut that's all im seeingEDIT: Not all obviously, but no binding for
getlocale.arihant2math commentedon Mar 3, 2025
time.tznameis now supported on all desktop platformsyouknowone commentedon Dec 25, 2025
Great, both of the list done