Edgewall Software
Modify

Opened 2 years ago

Closed 2 years ago

#12817 closed defect (fixed)

to_fragment() incorrectly uses only args[0] of exception if it is not a TracError

Reported by: Jun Omae Owned by: Jun Omae
Priority: normal Milestone: 1.0.14
Component: general Version: 1.0.5
Severity: normal Keywords:
Cc: Branch:
Release Notes:

Fix a regression in [13769], to_fragment() passed exception with parameters more than one, e.g. IOError.

API Changes:

Description (last modified by Jun Omae)

refs #12815.

When ticket notification with wrong configuration, the following is shown:

Warning: The change has been saved, but an error occurred while sending notifications: 535

The following is logged in trac.log:

2017-05-23 00:25:31,680 Trac[web_ui] ERROR: Failure sending notification on change to 
ticket #1: SMTPAuthenticationError: (535, '5.7.8 Username and Password not accepted. 
Learn more at\n5.7.8  https://support.google.com/mail/?p=BadCredentials b68sm7717040pfe.18 
- gsmtp')

The 535 is args[0] of occurred SMTPAuthenticationError.

another case:

>>> try:
...     open('/notfound')
... except IOError, e:
...     print(to_fragment(e))
...
2

See also [13769] (#11886).

Attachments (0)

Change History (5)

comment:1 by Jun Omae, 2 years ago

Description: modified (diff)

comment:2 by Jun Omae, 2 years ago

Proposed changes in [5949d50c7/jomae.git] but, if the exception class has custom __str__ method and size of args attribute is 1, to_fragment() would ignore the __str__ method.

comment:3 by Ryan J Ollos, 2 years ago

Looks good to me. Thanks for fixing.

comment:4 by Jun Omae, 2 years ago

Milestone: next-stable-1.0.x1.0.14
Owner: set to Jun Omae
Status: newassigned

Thanks. I push it shortly.

comment:5 by Jun Omae, 2 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Fixed in [15936] and merged in [15937-15938].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted. Next status will be 'reopened'.
to as closed The owner will be changed from Jun Omae to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.