Skip to content

locale support including _locale and time.tzname #3850

Closed

Description

@youknowone

Activity

  1. bongjunj commented on Nov 2, 2022

    @bongjunj
    Contributor

    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
    }

  2. bongjunj commented on Nov 2, 2022

    @bongjunj
    Contributor

    #4054

    If we are talking about holding states such as tzname (which is initialized at module load time), this can be related.

  3. youknowone commented on Nov 5, 2022

    @youknowone
    MemberAuthor

    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.

  4. youknowone commented on Nov 5, 2022

    @youknowone
    MemberAuthor

    And yes. #4054 is generally related to module attributes and hidden data like Info types in sys module.

  5. JazzGlobal commented on Apr 18, 2023

    @JazzGlobal
    Contributor

    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?

  6. DimitrisJim commented on Apr 18, 2023

    @DimitrisJim
    Member

    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?

  7. JazzGlobal commented on Apr 18, 2023

    @JazzGlobal
    Contributor

    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 .

  8. arihant2math commented on Mar 3, 2025

    @arihant2math
    Contributor

    time.tzname is now supported on all desktop platforms

  9. youknowone commented on Dec 25, 2025

    @youknowone
    MemberAuthor

    Great, both of the list done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions