Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bootloader: set configure_locale=1 in interpreter pre-config #8306

Merged
merged 3 commits into from Feb 17, 2024

Commits on Feb 17, 2024

  1. bootloader: set configure_locale=1 in interpreter pre-config

    Have bootloader set the `configure_locale` field in the interpreter
    pre-config structure, so that user-preferred locale is set during
    interpreter pre-initialization.
    
    This fixes regression w.r.t. PyInstaller 5.x and unfrozen python,
    where calling `locale.getlocale` in frozen application returns
    user-preferred locale, while frozen applications created by
    PyInstaller 6.x currently return `(None, None)`.
    
    In PyInstaller 5.x bootloader, user-preferred locale was set
    explicitly by bootloader calling `setlocale` in C code; now,
    we can let python interpreter (pre)initialization handle that
    for us.
    rokm committed Feb 17, 2024
    Configuration menu
    Copy the full SHA
    476d360 View commit details
    Browse the repository at this point in the history
  2. tests: add a test for user-preferred locale being set

    Add a test that ensures that user-preferred locale is set on the
    POSIX systems; i.e., that `locale.getlocale()` does not return
    `(None, None)` and that values in the tuple correspond to
    locale/encoding set via environment variable (`LC_ALL`).
    rokm committed Feb 17, 2024
    Configuration menu
    Copy the full SHA
    0b09b49 View commit details
    Browse the repository at this point in the history
  3. ci: install/enable extra locales on ubuntu CI runner

    The ubuntu CI runner does not come with any locales enabled, so
    we need to explicitly enable the following locales for
    `test_basic::test_user_preferred_locale`:
     - en_US.UTF-8
     - en_US (= en_US.ISO8859-1)
     - sl_SI.UTF-8
     - sl_SI (= sl_SI.ISO8859-2)
    
    In addition, `test_basic::test_time_module_localized` seems to
    be using `cs_CZ.UTF-8`, so enable that as well.
    rokm committed Feb 17, 2024
    Configuration menu
    Copy the full SHA
    a6f3e4d View commit details
    Browse the repository at this point in the history