Skip to content

Commit 01e2872

Browse files
committed
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.
1 parent 6ac6d34 commit 01e2872

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

CHANGES.txt

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,21 @@ Fixed:
1919
Meerwald)
2020
- exception in logout action when there is no session (Christof
2121
Meerwald)
22+
- Supply charset argument for connection creation for mysql, even for
23+
python2: The parameter was conditional on python version > 2 but seems to
24+
work fine with python2.7. According to the MySQLdb API docs, the
25+
charset argument is supported with MySQL 4.1 which was released in
26+
2004. (Ralf Schlatterbeck)
27+
28+
Features:
29+
30+
- When defining Link or Multilink properties in the schema, it's now
31+
possible to add a parameter rev_multilink that accepts a property name
32+
to be inserted into the linked-to class. So this creates a reverse
33+
Multilink property in the linked-to class. This Multilink is read-only
34+
(cannot be updated) but can be used in filter -- and thus in normal
35+
index templates as well as in the REST and XMLRPC APIs. (Ralf
36+
Schlatterbeck)
2237

2338
2020-04-05 2.0.0 beta 0
2439

@@ -74,13 +89,6 @@ Features:
7489
with new RoundupException (inheriting from Exception) for most
7590
roundup exceptions. (John Rouillard and Ralf Schlatterbeck on
7691
request from Robert Klonner.)
77-
- When defining Link or Multilink properties in the schema, it's now
78-
possible to add a parameter rev_multilink that accepts a property name
79-
to be inserted into the linked-to class. So this creates a reverse
80-
Multilink property in the linked-to class. This Multilink is read-only
81-
(cannot be updated) but can be used in filter -- and thus in normal
82-
index templates as well as in the REST and XMLRPC APIs. (Ralf
83-
Schlatterbeck)
8492

8593
Fixed:
8694

roundup/backends/back_mysql.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@ def connection_dict(config, dbnamestr=None):
5454
del d['password']
5555
if 'port' in d:
5656
d['port'] = int(d['port'])
57-
if sys.version_info[0] > 2:
58-
d['charset'] = 'utf8'
57+
# This was conditional on python version > 2 but seems to work fine
58+
# with python2.7. According to the MySQLdb API docs, the charset
59+
# argument is supported with MySQL 4.1 which was released in 2004.
60+
d['charset'] = 'utf8'
5961
return d
6062

6163
def db_nuke(config):

0 commit comments

Comments
 (0)