[Zope] Iteration over columns in ZSQLMethod result not working in Zope 2.12.13

Andreas Elvers andreas at work.de
Wed Dec 1 08:27:00 EST 2010


I stumbled over the following error using Zope 2.12.13. Bug ?

Given some ZSQLMethod,  and either ZMySQLDA (3.1.1) or ZPsycopgDA 
(2.0.14 or 2.2.2)
and the following python script:

result = context.someZSQLMethod()
for row in result:
    for col in row: #this will fail

I get an AttributeError: __iter__

Traceback (innermost last):
   Module ZPublisher.Publish, line 127, in publish
   Module ZPublisher.mapply, line 77, in mapply
   Module ZPublisher.Publish, line 47, in call_object
   Module Shared.DC.Scripts.Bindings, line 324, in __call__
   Module Shared.DC.Scripts.Bindings, line 361, in _bindAndExec
   Module Products.PythonScripts.PythonScript, line 344, in _exec
   Module script, line 3, in someZSQLMethod
    - <PythonScript at /testfolder/somePythonScript>
    - Line 3
   Module AccessControl.ZopeGuards, line 181, in next
   Module AccessControl.ZopeGuards, line 211, in guard
   Module AccessControl.SecurityManagement, line 21, in getSecurityManager
AttributeError: __iter__

- Andreas

More information about the Zope mailing list