Re: troubles with unicode

Oleg Broytman <[email protected]>
Newsgroups gmane.comp.python.sqlobject
Message-ID <[email protected]>
Hello!

On Sun, Jan 29, 2012 at 11:06:31AM +0100, Petr Jake?? wrote:
>   File "/usr/lib/python2.5/site-packages/SQLObject-0.10.1-py2.5.egg/sqlobject/main.py",
> line 1120, in set
>     self._connection._SO_update(self, args)
>   File "/usr/lib/python2.5/site-packages/SQLObject-0.10.1-py2.5.egg/sqlobject/dbconnection.py",
> line 509, in _SO_update
>     for dbName, value in values]),
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position
> 33: ordinal not in range(128)

   The error means there is at least one 8-bit str mixed with unicode.
If you are sure all values are str instances - what about dbNames?
_SO_update is called from set with dbNames from sqlmeta.columns:

                args = [(self.sqlmeta.columns[name].dbName, value)
                        for name, value in toUpdate.items()]
                self._connection._SO_update(self, args)

   Make sure all dbNames are also str, not unicode.

Oleg.
-- 
     Oleg Broytman            http://phdru.name/            [email protected]
           Programmers don't die, they just GOSUB without RETURN.

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.