-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 12/01/2010 08:27 AM, Andreas Elvers wrote: > Hi, > > 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 > pass > > 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__
I don't think the Record class fills the 'tp_iter' slot. Does the following workaround help? result = context.someZSQLMethod() for row in result: for i in range(len(row)): col = row[i[ Tres. - -- =================================================================== Tres Seaver +1 540-429-0999 tsea...@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkz2UxAACgkQ+gerLs4ltQ79tgCgvTqC6Kgsk60n7kUuh95FYfMQ Gd0An2al8dDlrfKvLT+VIJw3ODGacigo =YFm1 -----END PGP SIGNATURE----- _______________________________________________ Zope maillist - Zope@zope.org https://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope-dev )