GeezerVison is showing github.com — locale support including _locale and time.tzname · Issue #3850 · RustPython/RustPython
locale support including _locale and time.tzname #3850Activitybongjunj commented on Nov 2, 2022 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?
|
pub(crate) fn make_module(vm: &VirtualMachine) -> PyObjectRef { |
|
let module = time::make_module(vm); |
|
#[cfg(unix)] |
|
unix::extend_module(vm, &module); |
|
#[cfg(windows)] |
|
windows::extend_module(vm, &module); |
|
|
|
module |
|
} |
bongjunj commented on 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 commented on Nov 5, 2022
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. youknowone commented on Nov 5, 2022 And yes. #4054 is generally related to module attributes and hidden data like Info types in sys module. JazzGlobal commented on 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 getdefaultlocale so it can be used in our implementation? DimitrisJim commented on 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? Reacted by Christopher Gambrell JazzGlobal commented on Apr 18, 2023 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 . arihant2math commented on Mar 3, 2025 time.tzname is now supported on all desktop platforms
youknowone commented on Dec 25, 2025 Great, both of the list done
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|