len(l)
128
>>> db['check'] = marshal.dumps(l)
Traceback (most recent call last):
File "
File "C:\system\libs\e32dbm.py", line 145, in __setitem__
self._dbset(key,value)
File "C:\system\libs\e32dbm.py", line 100, in _dbset
self._execute(u"INSERT INTO data VALUES (%d,'%s','%s')"% (hash(key),sqlquote(key),sqlquote(value)))
UnicodeError: ASCII decoding error: ordinal not in range(128)
If the length of the list is 127, it stores fine in the database. Strange, huh? No! Doing, a db['check'] = unicode(marshal.dumps()) doesn't work either.
Workaround?
db['check'] = ';'.join(list)
list = db['check'].split(';')
No comments:
Post a Comment