MySQL Forums
Forum List  »  Connector/Python

MySQLdb issue
Posted by: Jan Eden
Date: May 30, 2006 01:35AM

Hi,

after upgrading to MySQL 5 and MySQLdb 1.2.1_p2, I have the following problem:

self.db=MySQLdb.connect(host=host, user=user, passwd=passwd, db=db, cursorclass=MySQLdb.cursors.DictCursor)
stringel = 'Some string'
stringel = self.db.escape(stringel)

File "./test.py", line 12, in ?
stringel = self.db.escape(stringel)
TypeError: no default type converter defined

I checked the documentation for MySQLdb.converters and saw that the escape() function takes a dictionary as an obligatory second argument.

This is odd, because I have always been using escape(string) without a problem.

The changes in MySQLdb 1.2.1_p2 list:

"Mapped a lot of new 4.1 and 5.0 error codes to Python exceptions"

Could someone point me to the problem in the MySQL side? Thanks in advance!

- Jan

Options: ReplyQuote


Subject
Written By
Posted
MySQLdb issue
May 30, 2006 01:35AM
June 21, 2008 06:01AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.