RustPython
RustPython copied to clipboard
locale support including _locale and time.tzname
- [ ]
_locale
module - [ ] time.tzname
https://docs.python.org/3/library/time.html#time.tzname
The doc says tzname
is determined at module load time. Does "module load time" mean those values to be initialized in the function below?
https://github.com/RustPython/RustPython/blob/77b821a1941019fe34f73ce17cea013ae1b98fd0/vm/src/stdlib/time.rs#L9-L17
#4054
If we are talking about holding states such as tzname
(which is initialized at module load time), this can be related.
The doc says tzname is determined at module load time. Does "module load time" mean those values to be initialized in the function below?
It may not be exactly, but you can regard it is.
And yes. #4054 is generally related to module attributes and hidden data like Info types in sys module.
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?
That's right, and gotcha. Looks like libc has bindings for setlocale
but that's all im seeing
EDIT: Not all obviously, but no binding for getlocale
.