Interactive debugging with Python and Zope
I wanted to collect in one place some very useful links providing information about enhanced debugging of Zope/Plone.
Sites
- http://tomster.org/blog/archive/2006/10/09/ipython-as-zope-shell
- http://michaelthornhill.blogspot.com/2005/08/team-development-with-plone-zope-zeo.html
- http://tomster.org/blog/archive/2006/10/09/pdp-tab-completion
- http://maurits.vanrees.org/weblog/2006/10/tab-completion.html
- http://wiki.python.org/moin/PdbRcIdea
- http://wiki.python.org/moin/PythonDebuggers
- http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/498182
- http://www.zopelabs.com/cookbook/1091472367
- http://wiki.zope.org/zope2/DebuggingWithIPythonAndOtherTips
Example from a debug session to check Unauthorized exception:
>>> syd = app.acl_users.getUser('syd')
>>> from AccessControl.SecurityManagement import newSecurityManager
>>> newSecurityManager(None,syd)
>>> from Testing import makerequest
>>> app = makerequest.makerequest(app)
>>> app.parecom.wiki.ParITWiki.view()
...
File "/opt/zope/Zope-2.8.7-final/lib/python/AccessControl/ImplPython.py", line 808, in raiseVerbose
raise Unauthorized(text)
AccessControl.unauthorized.Unauthorized: The owner of the executing
script does not have the required permission. Access to 'offspring' of
(ZWikiPage 'ParITWiki' at 0x2a9f0a11d0) denied. Access requires one of
the following roles: ['Manager', 'Member', 'Reviewer']. The executing
script is (FSDTMLMethod at /parecom/subtopics_outline used for
/parecom/wiki/ParITWiki), owned by Anonymous User, who has the roles
['Anonymous'].
>>>

