[Zope-DB] MySQL-python for Python 2.3: AttributeError on server_capabilities

Chris Withers chris at simplistix.co.uk
Sat Apr 3 10:56:04 EST 2004


Chris Withers wrote:

> There seem to be pretty major differences between the code in 
> MySQL-python-0.9.2.win32-py2.2.exe and 
> MySQL-python.exe-0.9.2.win32-py2.3.exe.

...furthermore, there also appear to be differences with the 
MySQL-python-0.9.2.win32-py2.1.exe file, which is what's causing the 
AttributeError's on server_capabilities when using ZMySQLDA on Zope 2.7.0, 
notice the two different behaviours here, in both cases kwargs is a dictionary 
containing a valid set of connection details:

Python 2.1.1 (#20, Jul 20 2001, 01:19:29) [MSC 32 bit (Intel)] on win32
Type "copyright", "credits" or "license" for more information.
 >>> import _mysql
 >>> c = _mysql.connect(**kwargs)
 >>> c.server_capabilities
8236

Python 2.3.3 (#51, Dec 18 2003, 20:22:39) [MSC v.1200 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
 >>> import _mysql
 >>> c = _mysql.connect(**kwargs)
 >>> c.server_capabilities
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
AttributeError: server_capabilities

Bizarely, though, MySQLdb.connect from both versions results in 
server_capabilities being available, I shall investigate further...

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk




More information about the Zope-DB mailing list