Mercurial > p > roundup > code
diff roundup/backends/back_mysql.py @ 6149:6a2de9606652
Supply charset utf-8 for mysql connection
Supply charset argument for connection creation for mysql, even for
python2: The parameter was conditional on python version > 2 but seems
to work fine with python2.7. According to the MySQLdb API docs, the
charset argument is supported with MySQL 4.1 which was released in 2004.
| author | Ralf Schlatterbeck <rsc@runtux.com> |
|---|---|
| date | Thu, 30 Apr 2020 13:27:04 +0200 |
| parents | 8497bf3f23a1 |
| children | 546763f4ce44 |
line wrap: on
line diff
--- a/roundup/backends/back_mysql.py Wed Apr 29 16:30:27 2020 +0200 +++ b/roundup/backends/back_mysql.py Thu Apr 30 13:27:04 2020 +0200 @@ -54,8 +54,10 @@ del d['password'] if 'port' in d: d['port'] = int(d['port']) - if sys.version_info[0] > 2: - d['charset'] = 'utf8' + # This was conditional on python version > 2 but seems to work fine + # with python2.7. According to the MySQLdb API docs, the charset + # argument is supported with MySQL 4.1 which was released in 2004. + d['charset'] = 'utf8' return d def db_nuke(config):
