alexhuntley / Plots

A graph plotting app for GNOME
GNU General Public License v3.0
189 stars 36 forks source link

Crash on start due to not supported locale #146

Open violoncelloCH opened 6 months ago

violoncelloCH commented 6 months ago

Thanks for this promising application. Sadly I can't use it as it simply doesn't open/crashes on startup. When running from cli, I get:

$ flatpak run com.github.alexhuntley.Plots 

(process:2): Gtk-WARNING **: 23:30:12.074: Locale not supported by C library.
    Using the fallback 'C' locale.
Traceback (most recent call last):
  File "/app/bin/plots", line 8, in <module>
    sys.exit(main())
  File "/app/lib/python3.10/site-packages/plots/__init__.py", line 22, in main
    plots.Plots().run(sys.argv)
  File "/app/lib/python3.10/site-packages/plots/plots.py", line 42, in __init__
    plots.i18n.bind()
  File "/app/lib/python3.10/site-packages/plots/i18n.py", line 26, in bind
    locale.setlocale(locale.LC_ALL, "")
  File "/usr/lib/python3.10/locale.py", line 620, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

My locale settings are:

$ locale
LANG=en_GB.UTF-8
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC=de_CH.UTF-8
LC_TIME=de_CH.UTF-8
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY=de_CH.UTF-8
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER=de_CH.UTF-8
LC_NAME="en_GB.UTF-8"
LC_ADDRESS=de_CH.UTF-8
LC_TELEPHONE=de_CH.UTF-8
LC_MEASUREMENT=de_CH.UTF-8
LC_IDENTIFICATION="en_GB.UTF-8"
LC_ALL=

Thanks :)

Paulemeister commented 1 month ago

Same problem here with the locale

locale                                                                         
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=de_DE.UTF-8
LC_TIME=de_DE.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=de_DE.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=de_DE.UTF-8
LC_NAME=de_DE.UTF-8
LC_ADDRESS=de_DE.UTF-8
LC_TELEPHONE=de_DE.UTF-8
LC_MEASUREMENT=de_DE.UTF-8
LC_IDENTIFICATION=de_DE.UTF-8
LC_ALL=

The workaround I found is to start the app with flatpak run --env=LC_ALL="en_US.UTF-8" com.github.alexhuntley.Plots or use flatpak override --user --env=LC_ALL="en_US.UTF-8" com.github.alexhuntley.Plots or use flatseal and add the environment variable there. ATTENTION: Flatseal requires there to be no quotationmarks around en_US.UTF-8