Skip to content

Commit

Permalink
Fix #16 locales error with Python 2
Browse files Browse the repository at this point in the history
Simply a workaround to ensure the call to locale.getlocale returns a valid locale.
Not sure if this the best solution (not a Python programmer -- yet!) but it works.
Have used this patch fine for 2 years now on my own Ubuntu 16.04 based system.
  • Loading branch information
savoury1 authored Aug 22, 2019
1 parent d2bdd6a commit 0995ed0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/MainWindow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,9 @@ def set_language(self):
app.language = language
app.debug_print("Set language: " + app.language)

# hacked by Rob Savoury to fix #16 locales error with Python 2
locale.setlocale(locale.LC_ALL,'')

self.encoding = unicode(locale.getlocale()[1])
app.debug_print("Set encoding: " + self.encoding)

Expand Down

0 comments on commit 0995ed0

Please sign in to comment.