summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2018-01-22 18:34:09 +0100
committeremkael <emkael@tlen.pl>2018-01-22 18:34:09 +0100
commitd20ee8df550eb0de822e536cbcba756fcbe340e1 (patch)
tree84de26373671ced0bc63626ae4e24a829d77931a
parentb2a3bc8b7527425d40448ebbc1f1318e31c3861d (diff)
Getting rid of MySQL error message encoding problems
-rw-r--r--jfr_playoff/db.py3
-rw-r--r--playoff.spec2
2 files changed, 4 insertions, 1 deletions
diff --git a/jfr_playoff/db.py b/jfr_playoff/db.py
index ad32ac8..f7efc7c 100644
--- a/jfr_playoff/db.py
+++ b/jfr_playoff/db.py
@@ -1,4 +1,5 @@
import mysql.connector
+import sys
class PlayoffDB(object):
@@ -6,6 +7,8 @@ class PlayoffDB(object):
db_cursor = None
def __init__(self, settings):
+ reload(sys)
+ sys.setdefaultencoding("latin1")
self.database = mysql.connector.connect(
user=settings['user'],
password=settings['pass'],
diff --git a/playoff.spec b/playoff.spec
index 7246d59..6b0906e 100644
--- a/playoff.spec
+++ b/playoff.spec
@@ -1,7 +1,7 @@
import os
a = Analysis(['playoff.py'],
pathex=[os.path.abspath('.')],
- hiddenimports=[],
+ hiddenimports=['mysql.connector.locales.eng.client_error'],
hookspath=None,
runtime_hooks=None,
excludes=None)