File tree Expand file tree Collapse file tree 3 files changed +16
-9
lines changed Expand file tree Collapse file tree 3 files changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -19,11 +19,6 @@ 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)
2722
2823Features:
2924
@@ -36,6 +31,13 @@ Features:
3631 Schlatterbeck)
3732- Add a 'is_restore_ok' method similar to 'is_retire_ok' for use in
3833 templates.
34+ - Allow to configure the mysql charset when opening a connection to the
35+ database. The parameter was conditional on python version > 2 but
36+ seems to work fine with python2.7. According to the MySQLdb API docs,
37+ the charset argument is supported with MySQL 4.1 which was released in
38+ 2004. There are some legacy reasons why one would want to not pass a
39+ charset argument or pass an argument different from the default of
40+ 'utf8'. (Ralf Schlatterbeck)
3941
40422020-04-05 2.0.0 beta 0
4143
Original file line number Diff line number Diff line change @@ -54,10 +54,9 @@ def connection_dict(config, dbnamestr=None):
5454 del d ['password' ]
5555 if 'port' in d :
5656 d ['port' ] = int (d ['port' ])
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'
57+ charset = config .RDBMS_MYSQL_CHARSET
58+ if charset != 'default' :
59+ d ['charset' ] = charset
6160 return d
6261
6362def db_nuke (config ):
Original file line number Diff line number Diff line change @@ -1047,6 +1047,12 @@ def str2value(self, value):
10471047 (NullableOption , 'read_default_group' , 'roundup' ,
10481048 "Name of the group to use in the MySQL defaults file (.my.cnf).\n "
10491049 "Only used in MySQL connections." ),
1050+ (Option , 'mysql_charset' , 'utf8' ,
1051+ "Charset to use for mysql connection,\n "
1052+ "use 'default' for the mysql default, no charset option\n "
1053+ "is used when creating the connection in that case.\n "
1054+ "Otherwise any permissible mysql charset is allowed here.\n "
1055+ "Only used in MySQL connections." ),
10501056 (IntegerNumberGeqZeroOption , 'sqlite_timeout' , '30' ,
10511057 "Number of seconds to wait when the SQLite database is locked\n "
10521058 "Default: use a 30 second timeout (extraordinarily generous)\n "
You can’t perform that action at this time.
0 commit comments