A
Achim Domma
Hi,
I'm using MySQLdb with Python 2.3 on windows. Querying a database seems to
work fine, but inserting does not. If I try something like this:
cursor.execute("insert into Webpages (Url) values (?)", (url,))
I get the following Error:
File "C:\Python23\Lib\site-packages\MySQLdb\cursors.py", line 95, in
execute
return self._execute(query, args)
File "C:\Python23\Lib\site-packages\MySQLdb\cursors.py", line 110, in
_execute
self.errorhandler(self, TypeError, m)
File "C:\Python23\Lib\site-packages\MySQLdb\connections.py", line 33, in
defaulterrorhandler
raise errorclass, errorvalue
TypeError: not all arguments converted during string formatting
url is a unicode string. I tried to convert it via url.encode('utf-8') to a
string, but this does not help. Any hint what's going wrong?
regards,
Achim
I'm using MySQLdb with Python 2.3 on windows. Querying a database seems to
work fine, but inserting does not. If I try something like this:
cursor.execute("insert into Webpages (Url) values (?)", (url,))
I get the following Error:
File "C:\Python23\Lib\site-packages\MySQLdb\cursors.py", line 95, in
execute
return self._execute(query, args)
File "C:\Python23\Lib\site-packages\MySQLdb\cursors.py", line 110, in
_execute
self.errorhandler(self, TypeError, m)
File "C:\Python23\Lib\site-packages\MySQLdb\connections.py", line 33, in
defaulterrorhandler
raise errorclass, errorvalue
TypeError: not all arguments converted during string formatting
url is a unicode string. I tried to convert it via url.encode('utf-8') to a
string, but this does not help. Any hint what's going wrong?
regards,
Achim