From d20ee8df550eb0de822e536cbcba756fcbe340e1 Mon Sep 17 00:00:00 2001 From: emkael Date: Mon, 22 Jan 2018 18:34:09 +0100 Subject: Getting rid of MySQL error message encoding problems --- jfr_playoff/db.py | 3 +++ playoff.spec | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3