Re: Unable to override locale within Python

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Il 13/01/22 15:24, Ondrej Mosnacek ha scritto:
> On Thu, Jan 13, 2022 at 2:44 PM Mattia Verga
> <mattia.verga@xxxxxxxxxxxxxx> wrote:
>> I'm running KDE/Plasma on Wayland both in my main workstation and in my
>> development virtual machine. On both machine it looks like Python is
>> unable to change the system's locale when running a script [1] in
>> Konsole, while the same script from a linux terminal runs fine.
>>
>> I tried to create a new user and logging in as this new user the script
>> runs fine in Konsole also. I cannot find any setting which may cause
>> that, I also tried to delete the konsole configuration file under
>> .config so as to reset from scratch, but with my main user I can't get
>> to run the script right.
>>
>> Any idea where I might look to find the cause?
> I believe your problem lies in the LANGUAGE environment variable
> (probably set to your local language by ~/.bashrc, ~/.bash_profile, or
> such), not in Konsole or KDE.
>
> In my environment I was able to reproduce a similar behavior as in
> your bug report with the linked Python snippet and adding
> LANGUAGE='en_US' to the env dict changed the strings to the English
> language for me.
>
> Cheers,
>
> --
> Ondrej Mosnacek
> Software Engineer, Linux Security - SELinux kernel
> Red Hat, Inc.
Thanks, your hint has made me making some progress.

By comparing the `printenv` output in linux terminal and in konsole I
see that both have `LANG=it_IT.UTF-8` (which is correct), but konsole
adds `LANGUAGE=it:en_US` which seems a strange value.
Unset the LANGUAGE variable make the script run fine.

I now have to find out what KDE setting is injecting the LANGUAGE
variable... there's nothing in bashrc or bash_profile, so it may be some
KDE setting.

Mattia
_______________________________________________
kde mailing list -- kde@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to kde-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/kde@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure




[Index of Archives]     [KDE Users]     [Fedora General Discussion]     [Older Fedora Users Mail]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Maintainers]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Triage]     [Coolkey]     [Yum Users]     [Yosemite Forum]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]

  Powered by Linux