Roundup Tracker - Issues

Issue 2551057

classification
Title: No message with DetectorError with Python2
Type: Severity: normal
Components: Versions: devel
process
Status: new Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: rouilj, schlatterbeck
Priority: high Keywords: Effort-High, python2

Created on 2019-09-09 17:23 by schlatterbeck, last changed 2019-09-17 21:04 by rouilj.

Messages
msg6623 Author: [hidden] (schlatterbeck) Date: 2019-09-09 17:23
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
msg6624 Author: [hidden] (schlatterbeck) Date: 2019-09-09 17:39
I'm now calling the base class __init__ with a message manufactured from
some of the parameters.
msg6643 Author: [hidden] (rouilj) Date: 2019-09-17 21:04
Ralf, I see you committed a change to fix this.
Was it a successful fix so this can be closed?
History
Date User Action Args
2019-09-17 21:04:34rouiljsetnosy: + rouilj
messages: + msg6643
2019-09-09 17:39:57schlatterbecksetmessages: + msg6624
2019-09-09 17:23:40schlatterbeckcreate