Contact: fumanchu@aminus.org

Log in as guest/geniusql to create tickets

Changeset 229

Show
Ignore:
Timestamp:
11/17/07 16:48:56
Author:
fumanchu
Message:

Woops. MySQL reminded me to implement the reverse encoding dance when pickling.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/geniusql/adapters.py

    r225 r229  
    383383            value = value.encode('raw-unicode-escape') 
    384384        else: 
    385             value = str(value) 
     385            # Now, take pains to re-decode it with dbtype.encoding. As far 
     386            # as I know, MySQL is the only DB that really needs the value 
     387            # re-decoded, but the others seem to survive with this step. 
     388            value = unicode(value, dbtype.encoding).encode('raw-unicode-escape') 
    386389        return pickle.loads(value) 
    387390