Formulator and ZDebug incompatibility
Hi, I posted this question on the Formulator mailing list but it didn't seem to interest anyone there, so I'm posting it here in hope that anyone here has some helpful info or a workaround. It seems that Formulator is still incompatible with ZDebug. This problem was discussed briefly back in May 2001 (<http://lists.zope.org/pipermail/zope/2001-May/091103.html>), related to Formulator 0.9.1 and ZDebug 0.2. I'm using Formulator 1.2.0 and ZDebug 0.3 in Zope 2.4.4b1, and I have the same problem - an error message if a form field fails to validate - although the error message is a bit different this time: Error type: TypeError Error value: __init__() takes exactly 3 arguments (2 given) Traceback (innermost last): File /usr/local/zope/2.4.4b1/lib/python/ZPublisher/Publish.py, line 223, in publish_module File /usr/local/zope/2.4.4b1/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/local/zope/2.4.4b1/lib/python/Zope/__init__.py, line 226, in zpublisher_exception_hook (Object: Forms) File /usr/local/zope/2.4.4b1/lib/python/ZPublisher/Publish.py, line 171, in publish File /usr/local/zope/2.4.4b1/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: feedback) File /usr/local/zope/2.4.4b1/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: feedback) File /usr/local/zope/2.4.4b1/lib/python/OFS/DTMLMethod.py, line 200, in __call__ (Object: feedback) File /usr/local/zope/2.4.4b1/lib/python/DocumentTemplate/DT_String.py, line 546, in __call__ (Object: feedback) File /.../Zope/Products/ZDebug/DTMLDebug.py, line 305, in debug_render_blocks File /.../Zope/Products/ZDebug/DTMLDebug.py, line 237, in debugException File /.../Zope/Products/ZDebug/DTMLDebug.py, line 303, in debug_render_blocks File /usr/local/zope/2.4.4b1/lib/python/DocumentTemplate/DT_Try.py, line 212, in render File /usr/local/zope/2.4.4b1/lib/python/DocumentTemplate/DT_Try.py, line 221, in render_try_except File /.../Zope/Products/ZDebug/DTMLDebug.py, line 287, in debug_render_blocks File /.../Zope/Products/ZDebug/DTMLDebug.py, line 237, in debugException File /.../Zope/Products/ZDebug/DTMLDebug.py, line 182, in debugWithNamespace TypeError: (see above) Anybody else seeing this? Anything I can do about it? TIA, Itai -- -- Itai Tavor -- "Je sautille, donc je suis." -- itai@optusnet.com.au -- - Kermit the Frog -- -- -- -- "If you haven't got your health, you haven't got anything" --
Itai Tavor writes:
I posted this question on the Formulator mailing list but it didn't seem to interest anyone there, so I'm posting it here in hope that anyone here has some helpful info or a workaround.
It seems that Formulator is still incompatible with ZDebug. This problem was discussed briefly back in May 2001 (<http://lists.zope.org/pipermail/zope/2001-May/091103.html>), related to Formulator 0.9.1 and ZDebug 0.2. I'm using Formulator 1.2.0 and ZDebug 0.3 in Zope 2.4.4b1, and I have the same problem - an error message if a form field fails to validate - although the error message is a bit different this time:
Error type: TypeError Error value: __init__() takes exactly 3 arguments (2 given) I think I met this error:
Then, the offending "__init__" would be an exception constructor. ZDebug tries to put its additional information (DTML namespace, authenticated, REQUEST, ...) into the exception it caught. It does this by reraising the exception with additional information. This works fine for Zope's standard exceptions. But Formulator exceptions do not play well with this approach. I worked around this problem by constructing the new exception in a "try: ... except:". When it gets an exception, I raise the original exception. It's a hack but allowed me to use ZDebug together with Formulator. Dieter
Itai Tavor writes:
I posted this question on the Formulator mailing list but it didn't seem to interest anyone there, so I'm posting it here in hope that anyone here has some helpful info or a workaround.
It seems that Formulator is still incompatible with ZDebug. This problem was discussed briefly back in May 2001 (<http://lists.zope.org/pipermail/zope/2001-May/091103.html>), related to Formulator 0.9.1 and ZDebug 0.2. I'm using Formulator 1.2.0 and ZDebug 0.3 in Zope 2.4.4b1, and I have the same problem - an error message if a form field fails to validate - although the error message is a bit different this time:
Error type: TypeError Error value: __init__() takes exactly 3 arguments (2 given) I think I met this error:
Then, the offending "__init__" would be an exception constructor.
ZDebug tries to put its additional information (DTML namespace, authenticated, REQUEST, ...) into the exception it caught. It does this by reraising the exception with additional information.
This works fine for Zope's standard exceptions. But Formulator exceptions do not play well with this approach.
I worked around this problem by constructing the new exception in a "try: ... except:". When it gets an exception, I raise the original exception. It's a hack but allowed me to use ZDebug together with Formulator.
Thanks, Dieter. This change worked around the problem for me as well. I couldn't figure out what ZDebug was doing from looking at the source, but it was easy with your explanation. -- -- Itai Tavor -- "Je sautille, donc je suis." -- itai@optusnet.com.au -- - Kermit the Frog -- -- -- -- "If you haven't got your health, you haven't got anything" --
participants (2)
-
Dieter Maurer -
Itai Tavor