Il 13/01/22 15:24, Ondrej Mosnacek ha scritto:
On Thu, Jan 13, 2022 at 2:44 PM Mattia Verga
<mattia.verga(a)protonmail.com> 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