Skip to content

Commit e440e80

Browse files
committed
Fix string conversion from database
The sql_to_hyperdb_value table would convert strings coming from the database using "str". This is now changed to "us2s", converting unicode strings coming from the database to utf-8. This happens only for python2, for python3 the database interface uses unicode (aka str in python3). This fixes the behaviour for mysql if utf8 encoding is chosen explicitly, it seems in that case the database interface returns values as python2 unicode objects.
1 parent 1567180 commit e440e80

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

roundup/backends/rdbms_common.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
Multilink, DatabaseError, Boolean, Number, Integer
6161
from roundup.i18n import _
6262

63-
6463
# support
6564
from roundup.backends.blobfiles import FileStorage
6665
from roundup.backends.indexer_common import get_indexer
@@ -1105,7 +1104,7 @@ def setnode(self, classname, nodeid, values, multilink_changes={}):
11051104
self.sql(sql, [int(nodeid)] + remove)
11061105

11071106
sql_to_hyperdb_value = {
1108-
hyperdb.String : str,
1107+
hyperdb.String : us2s,
11091108
hyperdb.Date : date_to_hyperdb_value,
11101109
# hyperdb.Link : int, # XXX numeric ids
11111110
hyperdb.Link : str,

0 commit comments

Comments
 (0)