> On Wed, Feb 21, 2007 at 01:20:31PM +0100, bernhard.maeder@zkb.ch wrote:
> > The following script produces errors when assigning the string or the
> > unicode column:
>    And what are those errors?

I'm sorry, I forgot to paste this:

Traceback (most recent call last):
  File "test.py", line 17, in ?
    a.aString           = 'gaäää'
  File "<string>", line 1, in <lambda>
  File "/home/bernhard/sqlobject/sqlobject/main.py", line 1081, in _SO_setValue
  File "/home/bernhard/sqlobject/sqlobject/dbconnection.py", line 614, in _SO_update
    self.query("UPDATE %s SET %s WHERE %s = (%s)" %
  File "/home/bernhard/sqlobject/sqlobject/dbconnection.py", line 316, in query
    return self._runWithConnection(self._query, s)
  File "/home/bernhard/sqlobject/sqlobject/dbconnection.py", line 230, in _runWithConnection
    val = meth(conn, *args)
  File "/home/bernhard/sqlobject/sqlobject/dbconnection.py", line 313, in _query
    self._executeRetry(conn, conn.cursor(), s)
  File "/home/bernhard/sqlobject/sqlobject/mysql/mysqlconnection.py", line 98, in _executeRetry
    myquery = unicode(query, self.encoding)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 33: ordinal not in range(128)

I now found that adding

  sqlobject.sqlhub.processConnection.encoding = 'iso8859-1'

to the code resolves the errors. What exactly am I doing with this? Is it even legal? :-)

Thanks a lot


Diese Mitteilung ist nur fuer die Empfaengerin / den Empfaenger bestimmt.

Fuer den Fall, dass sie von nichtberechtigten Personen empfangen wird, bitten wir diese hoeflich, die Mitteilung an die ZKB zurueckzusenden und anschliessend die Mitteilung mit allen Anhaengen sowie allfaellige Kopien zu vernichten bzw. zu loeschen. Der Gebrauch der Information ist verboten.

This message is intended only for the named recipient and may contain confidential or privileged information.

If you have received it in error, please advise the sender by return e-mail and delete this message and any attachments. Any unauthorised use or dissemination of this information is strictly prohibited.