Re: Bug in pydo.base.PyDO._update_raw?

Hamish Lawson <[email protected]> Tue, 31 May 2005 19:50:07 +0100
Newsgroups gmane.comp.web.skunkweb
Message-ID <[email protected]>
Jacob Smullyan wrote:

> On Tue, May 31, 2005 at 07:10:53PM +0100, Hamish Lawson wrote:
> 
>>pydo.base.PyDO._update_raw contains the following code:
>>
>>    values=converter.values
>>    where, wvals=self._uniqueWhere(conn, self)
>>    values+=wvals
>>
>>Are values and wvals meant to be dictionaries? In which case, += is not 
>>defined for those operands.
> 
> 
> You are right, converter.values can be a dictionary if the paramstyle
> is 'named' or 'pyformat'; otherwise, it will be a list.  Since the
> drivers we have so far don't used 'named' or 'pyformat', this hasn't
> been a problem so far.  

Yes, I'd since found myself that they're lists when the paramstyle is 
'format'. Perhaps a type test could use .update instead when we have 
dictionaries.

> This needs a careful fix, because at the moment two converters are
> being used, and they would end up generating the same interpolation
> names for the named/pyformat styles, and the bind variables would end
> up clobbering each other.

I'd just found this too and was about to flag it! :-)

> I'm making it so that only one converter
> instance is used, and will check in the fix shortly.

Excellent!


Hamish


-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005