diff options
author | Jonathan Bauer | 2022-04-26 16:47:16 +0200 |
---|---|---|
committer | Jonathan Bauer | 2022-04-26 16:47:16 +0200 |
commit | 7642211af1be9a6fd15fb50f2b31350487c3fe14 (patch) | |
tree | 87dec0cdbb3e7ac8765fa63751dd7419f7a43909 | |
parent | 'testserver' -> tinyint(1) (diff) | |
download | bwlp-statistics-7642211af1be9a6fd15fb50f2b31350487c3fe14.tar.gz bwlp-statistics-7642211af1be9a6fd15fb50f2b31350487c3fe14.tar.xz bwlp-statistics-7642211af1be9a6fd15fb50f2b31350487c3fe14.zip |
import.py: make pymysql.connect call explicit
-rw-r--r-- | import/import.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/import/import.py b/import/import.py index 24a871c..2c22363 100644 --- a/import/import.py +++ b/import/import.py @@ -19,7 +19,7 @@ filename = os.path.basename(sys.argv[1]) ip = re.search('_([0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3})[_\.]', filename).group(1) -db = pymysql.connect(c.get('db', 'host'), c.get('db', 'username'), c.get('db', 'password'), c.get('db', 'name'), cursorclass=pymysql.cursors.DictCursor) +db = pymysql.connect(host=c.get('db', 'host'), user=c.get('db', 'username'), password=c.get('db', 'password'), database=c.get('db', 'name'), charset='utf8mb4', cursorclass=pymysql.cursors.DictCursor) cursor = db.cursor() # Check if ip is already in names table |