Debugger into python products with ZEO2 on win32
I have CVS ZEO2, Zope 2.5.1 running on WinXP, PythonWin for Python 2.1 installed. I need to learn how to use a debugger to get information on what's happening on live objects (i.e when a form is submitted, I'd like to view the request and step through) Specifically I have a strange string.strip() error that just popped up on a customized Formulator product I'm working on, and I figure I should be able to debug this better than the traceback (see below). I can open up PythonWin or zope's console python and after Import Zope'ing, I can access the object model. While that's been invaluable as a sort of offline code-completion, that really isn't helping me debug live object behavior, which is where I'm running into some diffuculty as my product comes into shape. I'd really like to learn how to do this with the console or PythonWin, rather than use WingIDE or another IDE, but whatever it takes I'll do. With the setup I have, is there anything I can do to debug what happens at a specific request like the one described here? Zope has encountered an error while publishing this resource. Error Type: AttributeError Error Value: strip Traceback (innermost last): File C:\Program Files\Zope\lib\python\ZPublisher\Publish.py, line 150, in publish_module File C:\Program Files\Zope\lib\python\ZPublisher\Publish.py, line 114, in publish File C:\PROGRA~1\Zope\lib\python\Zope\__init__.py, line 159, in zpublisher_exception_hook (Object: dt1) File C:\Program Files\Zope\lib\python\ZPublisher\Publish.py, line 98, in publish File C:\PROGRA~1\Zope\lib\python\ZPublisher\mapply.py, line 88, in mapply (Object: manage_edit) File C:\Program Files\Zope\lib\python\ZPublisher\Publish.py, line 39, in call_object (Object: manage_edit) File C:\Program Files\Zope\lib\python\Products\MyFormulatorExt\Field.py, line 267, in manage_edit (Object: dt1) File C:\Program Files\Zope\lib\python\Products\MyFormulatorExt\Form.py, line 270, in validate File C:\Program Files\Zope\lib\python\Products\MyFormulatorExt\Field.py, line 215, in validate (Object: default) File C:\Program Files\Zope\lib\python\Products\MyFormulatorExt\Field.py, line 204, in _validate_helper (Object: default) File C:\Program Files\Zope\lib\python\Products\MyFormulatorExt\Validator.py, line 546, in validate File C:\Program Files\Zope\lib\python\Products\MyFormulatorExt\Field.py, line 221, in validate_sub_field (Object: default) File C:\Program Files\Zope\lib\python\Products\MyFormulatorExt\Field.py, line 204, in _validate_helper (Object: hour) File C:\Program Files\Zope\lib\python\Products\MyFormulatorExt\Validator.py, line 191, in validate File C:\Program Files\Zope\lib\python\Products\MyFormulatorExt\Validator.py, line 55, in validate File C:\Program Files\Zope/bin/lib\string.py, line 80, in strip AttributeError: (see above)
I found information in the Zope Dev Guide about debugging, but the particular error I'm trying to debug comes on a formulator management screen (when I save properties or test/validate a customized datetime field), and it needs user authorization. Is there any documentation on how I should pass user auth info to the ZPublisher.Zope(url, pm=1) method when calling it directly from python? Thanks.
ZPublisher.Zope('/Formulator/edi1/dt1/manage_edit', pm=1) Traceback (most recent call last): File "<interactive input>", line 1, in ? File "C:\Program Files\Zope\lib\python\ZPublisher\__init__.py", line 42, in Zope return apply(test, ('Zope',)+args, kw) File "C:\PROGRA~1\Zope\lib\python\ZPublisher\Test.py", line 368, in publish publish_module_pm(file, environ=env, stdout=stdout, extra=extra) File "C:\PROGRA~1\Zope\lib\python\ZPublisher\Test.py", line 229, in publish_module_pm response = publish(request, module_name, after_list, debug=debug) File "C:\Program Files\Zope\lib\python\ZPublisher\Publish.py", line 114, in publish sys.exc_info()[2], File "C:\PROGRA~1\Zope\lib\python\Zope\__init__.py", line 159, in zpublisher_exception_hook f(client, REQUEST, t, v, traceback) File "C:\Program Files\Zope\lib\python\ZPublisher\Publish.py", line 89, in publish object=request.traverse(path, validated_hook=validated_hook) File "C:\PROGRA~1\Zope\lib\python\ZPublisher\BaseRequest.py", line 404, in traverse response.unauthorized() File "C:\Program Files\Zope\lib\python\ZPublisher\HTTPResponse.py", line 533, in unauthorized raise Unauthorized, m Unauthorized: <html><head><title>dt1</title></head><body bgcolor="#FFFFFF">
<strong>You are not authorized to access this resource.</strong> <p><a href="http://www.zope.org/Credits" target="_top"><img src="http://127.0.0.1/Zope/p_/ZopeButton" width="115" height="50" border="0" alt="Powered by Zope" /></a></p></body></html>
participants (1)
-
Jeff Kowalczyk