Vlastimil Brom vlastimil.brom at gmail.com
Mon Dec 17 20:55:03 CET 2012

2012/12/17 Anatoli Hristov <tolidtm at gmail.com>:
>> src.decode() is creating a unicode string.  The error is not happening
>> there.  But when print is used with a unicode string, it has to encode
>> the data.  And for whatever reason, yours is using latin-1, and you have
>> a character in there which is not in the latin-1 encoding.
> I fixed the print, I changed the setting of the terminal and also on
> the sshconfig, so now when I print I'm able to print out without
> problems, but when I tried to run the script I've made it gives me
> again the same error :
> ""Unexpected error: exceptions.UnicodeEncodeError
> """
> Maybe I will try to update to 2.7
> --
> http://mail.python.org/mailman/listinfo/python-list

Well, we don't see the context or traceback of that error, but it
looks like a mysql error on inserting data.
Could it be, that your database is not unicode enabled, e.g. utf-8,
but, say, latin-1?
I don't have experiences with this database this, but I guess, there
must be some configure options for this.
Would maybe setting the encoding in db.connect(...) work?

Hopefully, others might give more reliable suggestions..


More information about the Python-list mailing list