[SQL-CVS] [ sqlobject-Bugs-1094171 ] unicode queries break
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
|
From: SourceForge.net <no...@so...> - 2006-01-12 12:24:31
|
Bugs item #1094171, was opened at 2005-01-01 20:59 Message generated for change (Comment added) made by wichert You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1094171&group_id=74338 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: General Group: SQLObject from repository >Status: Open Resolution: Fixed Priority: 5 Submitted By: Wichert Akkerman (wichert) Assigned to: Nobody/Anonymous (nobody) Summary: unicode queries break Initial Comment: When trying to store unicode data in a database I get an exception with the backtrace below. Tested using current SVN trunk. File "./parse", line 10, in StoreChannels nc[xid]=tvguide.database.Channel.byXid(xid) File "<string>", line 1, in <lambda> File "/usr/local/lib/python2.3/site-packages/sqlobject/main.py", line 961, in _SO_fetchAlternateID value) File "/usr/local/lib/python2.3/site-packages/sqlobject/dbconnection.py", line 400, in _SO_selectOneAlt return self.queryOne("SELECT %s FROM %s WHERE %s = %s" % File "/usr/local/lib/python2.3/site-packages/sqlobject/dbconnection.py", line 230, in queryOne return self._runWithConnection(self._queryOne, s) File "/usr/local/lib/python2.3/site-packages/sqlobject/dbconnection.py", line 125, in _runWithConnection val = meth(conn, *args) File "/usr/local/lib/python2.3/site-packages/sqlobject/dbconnection.py", line 223, in _queryOne self._executeRetry(conn, c, s) File "/usr/local/lib/python2.3/site-packages/sqlobject/dbconnection.py", line 196, in _executeRetry return cursor.execute(query) TypeError: argument 1 must be str, not unicode ---------------------------------------------------------------------- >Comment By: Wichert Akkerman (wichert) Date: 2006-01-12 13:24 Message: Logged In: YES user_id=15420 This code did use a UnicodeCol. The class definition used is: class Channel(sqlobject.SQLObject): xid = sqlobject.StringCol(length=32, varchar=True, alternateID=True) name = sqlobject.UnicodeCol(length=64, varchar=True, notNone=True) programs = sqlobject.MultipleJoin("Program") xid is not StringCol here, which is correct it is only allowed to store ASCII data. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2005-06-17 13:18 Message: Logged In: YES user_id=4799 Use UnicodeCol to convert unicode to DB strings. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2005-03-01 16:12 Message: Logged In: YES user_id=4799 What type is xid column? Can you provide a test program? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1094171&group_id=74338 |