Flameshot version
Flameshot v0.6.0
Compiled with Qt 5.12.1
Describe the bug
GUI application crashes when trying to save, upload to imgur, or other functions. Copy to clipboard still works.
Running flameshot from the terminal ($ flameshot) and then trying to capture produces this input:
QPainter::setRenderHint: Painter must be active to set rendering hints
QPainter::setCompositionMode: Painter not active
QPainter::translate: Painter not active
QPainter::setPen: Painter not active
QPainter::setBrush: Painter not active
QPainter::setBrush: Painter not active
QPainter::begin: Paint device returned engine == 0, type: 2
QPainter::setRenderHint: Painter must be active to set rendering hints
QPainter::setCompositionMode: Painter not active
QPainter::translate: Painter not active
QPainter::setPen: Painter not active
QPainter::setBrush: Painter not active
QPainter::setBrush: Painter not active
terminate called after throwing an instance of 'std::runtime_error'
what(): locale::facet::_S_create_c_locale name not valid
I assume only the last part is what's important here, from what I saw online this can be locale related, but I reset my locale to default.
Here are my locale settings, since this might be the issue (not sure):
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
If you see an issue with the above let me know, I don't know what it is...
To Reproduce
Launching the app, trying any of the saving functions.
Expected behavior
This used to work for me, possible before locale changes (I was trying to change the date format). I used to be able to save and upload to imgur.
System Information
4.19.49-1-MANJARO KDE Plasma 5.15.5
Same here, flameshot started crashing at launch when I changed the date+time format in Plasma to something other than the system locale. Works fine now that I reverted the datetime format change and changed the system locale instead.
Thanks for noting that important tidbit! Working through, I figured out my LC_TIME was en_GB.UTF-8 for 24-hour purposes. ~/.config/plasma-localerc read likewise to confirm.
In my case, I needed to uncomment that locale in my /etc/locale.gen and locale-gen. It appears KDE struggles to set them all if one is missing?
@spotlightishere Is this a KDE bug then ?
This is KDE related, but I'm not sure it's a KDE bug...
At any case, it sucks I have to change back to a time format I'm not comfortable in (think about this for a minute, the way you describe time is everywhere, it's your entire organizational system) to use an app.
Is there a KDE solution or a link as a reference perhaps?
I'm encountering this exact same issue in Ubuntu 20.04 LTE running Plasma KDE. Any solutions yet?
Can you upload the exact step by step process to create the bug on plasma? That will help me track it down much more quickly.
I have a quick test case: consider unsetting all locale-related environment variables and run "flameshot" from terminal: flameshot should crash. This may or may not share the same origin as the original report but worth trying.
I had the same issue,
running LC_ALL=C flameshot solved the issue
Thanks krivahtoo . That works!
Maybe this should be mentioned in the README ?
I've realised there there is an issue with using LC_ALL=C flameshot. The saved file is locked, so you can't import it into things like Google docs (at least directly).
@spotlightishere solution works well in KDE
Most helpful comment
I had the same issue,
running
LC_ALL=C flameshotsolved the issue