Roundup Tracker - Issues

Message6623

Author schlatterbeck
Recipients schlatterbeck
Date 2019-09-09.17:23:39
Message-id <1568049820.08.0.861180611562.issue2551057@roundup.psfhosted.org>
In-reply-to
When a detector has a serious problem (e.g. I/O Error, division by zero,
etc,) ultimately a DetectorError is raised. This is defined in
cgi/exceptions.py.

Now I got a Detector Error without any message about what was wrong.

Looks like the Detector Error *does* print its parameters with python3
but not with python2, see the test-script below.

Anybody in-the-know can tell us how to correctly define a custom
exception in python2 that prints its parameters?

python3:

>>> from roundup.cgi.exceptions import DetectorError
>>> raise DetectorError ('Bla', 'some html', 'some text')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
roundup.cgi.exceptions.DetectorError: ('Bla', 'some html', 'some text')

python2:
>>> from roundup.cgi.exceptions import DetectorError
>>> raise DetectorError ('Bla', 'some html', 'some text')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
roundup.cgi.exceptions.DetectorError
History
Date User Action Args
2019-09-09 17:23:40schlatterbecksetrecipients: + schlatterbeck
2019-09-09 17:23:40schlatterbecksetmessageid: <1568049820.08.0.861180611562.issue2551057@roundup.psfhosted.org>
2019-09-09 17:23:40schlatterbecklinkissue2551057 messages
2019-09-09 17:23:39schlatterbeckcreate