Roundup Tracker - Issues

Issue 2551057

classification
Title: No message with DetectorError with Python2
Type: crash Severity: normal
Components: Versions: devel
process
Status: fixed Resolution: fixed
Dependencies: Superseder:
Assigned To: schlatterbeck Nosy List: rouilj, schlatterbeck
Priority: high Keywords: NeedsTesting

Created on 2019-09-09 17:23 by schlatterbeck, last changed 2019-10-20 21:36 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?
msg6644 Author: [hidden] (schlatterbeck) Date: 2019-09-18 07:13
On Tue, Sep 17, 2019 at 09:04:34PM +0000, John Rouillard wrote:
> 
> Ralf, I see you committed a change to fix this.
> Was it a successful fix so this can be closed?

Yes, I think we can close it although I've not yet observed the effect
of the change in a running system yet. (I *did* test it on the
command-line as indicated).

Ralf
-- 
Dr. Ralf Schlatterbeck                  Tel:   +43/2243/26465-16
Open Source Consulting                  www:   http://www.runtux.com
Reichergasse 131, A-3411 Weidling       email: office@runtux.com
msg6757 Author: [hidden] (rouilj) Date: 2019-10-20 21:36
Closing as fixed.
History
Date User Action Args
2019-10-20 21:36:08rouiljsetstatus: open -> fixed
resolution: remind -> fixed
messages: + msg6757
2019-10-20 21:35:40rouiljsetresolution: remind
2019-10-11 01:59:32rouiljsetkeywords: + NeedsTesting, - Effort-High, python2
assignee: schlatterbeck
status: new -> open
type: crash
2019-09-18 07:13:00schlatterbecksetmessages: + msg6644
2019-09-17 21:04:34rouiljsetnosy: + rouilj
messages: + msg6643
2019-09-09 17:39:57schlatterbecksetmessages: + msg6624
2019-09-09 17:23:40schlatterbeckcreate