[Zope-DB] Re: Weird Python 2.3 subclassing thing with _mysql and MySQLdb

Michal Kurowski michal at genesilico.pl
Sat Apr 3 12:18:04 EST 2004


Chris Withers [chris at simplistix.co.uk] wrote:
> 
> ...define kwargs...
> 
> >>> c = _mysql.connection(**kwargs)
> >>> c
> <_mysql.connection open to 'localhost' at 7b8858>
> >>> c.server_capabilities
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> AttributeError: server_capabilities
> 
> ...hmmm, okay, so no server_capabilties attribute...
> 
> >>> class test(_mysql.connection): pass
> ...
> >>> c = test(**kwargs)
> >>> c
> <_mysql.connection open to 'localhost' at 82c2a0>
> >>> c.server_capabilities
> 8236
> 
> ...BWAGGGHH?!

... exactly ;-)

Changing:

transactional = self.db.server_capabilities & CLIENT.TRANSACTIONS

to:

transactional =  CLIENT.TRANSACTIONS 

db.py file from ZmySQLDA is requirement for python 2.3.3 based 
zope to work.

Can anyone explain to me why "_mysql" (instead of "MySQLdb") is used
here in the first place ?

Andy Dustman recommends against it for years now.
 
-- 
Michal Kurowski
perl -e '$_=q#: 13_2: 12/o{>: 8_4) (_4: 6/2^-2; 3;-2^\2: 5/7\_/\7: 12m m::#;
y#:#\n#;s#(\D)(\d+)#$1x$2#ge;print'




More information about the Zope-DB mailing list