mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-08 12:04:16 +02:00
[fix] crashes when Python is not able to retrieve the default locale
This commit is contained in:
@@ -68,6 +68,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||||||
### Fixes
|
### Fixes
|
||||||
- table not displaying all updates when the "updates filter" is clicked several times
|
- table not displaying all updates when the "updates filter" is clicked several times
|
||||||
- installation logs written to the wrong temp directory
|
- installation logs written to the wrong temp directory
|
||||||
|
- crashes when Python is not able to retrieve the default locale [#84](https://github.com/vinifmor/bauh/issues/84)
|
||||||
- Arch / AUR:
|
- Arch / AUR:
|
||||||
- sorting algorithm was providing wrong results for some cases
|
- sorting algorithm was providing wrong results for some cases
|
||||||
- not caching data about packages with no desktop entry files
|
- not caching data about packages with no desktop entry files
|
||||||
|
|||||||
@@ -49,7 +49,14 @@ def get_locale_keys(key: str = None, locale_dir: str = resource.get_path('locale
|
|||||||
locale_path = None
|
locale_path = None
|
||||||
|
|
||||||
if key is None:
|
if key is None:
|
||||||
current_locale = locale.getdefaultlocale()
|
try:
|
||||||
|
current_locale = locale.getdefaultlocale()
|
||||||
|
|
||||||
|
if current_locale is None or current_locale[0] is None:
|
||||||
|
current_locale = ('en', 'UTF-8')
|
||||||
|
except:
|
||||||
|
current_locale = ('en', 'UTF-8')
|
||||||
|
|
||||||
else:
|
else:
|
||||||
current_locale = [key.strip().lower()]
|
current_locale = [key.strip().lower()]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user