Skip to content

Commit 9ec099f

Browse files
committed
Fix issue2550843 (AttributeError: 'Unauthorised' object has no attribute 'replace')
Pass text of Unauthorised and Login exceptions instead of the exception instance to avoid traceback with string operations. str() is used in most other places where the exception error message text is needed. So far only roundup.cgi.actions.LoginAction.handle() iterates over the exception args. Probably not needed here, so I decided to keep the code simple.
1 parent e5dc8b9 commit 9ec099f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ Fixed:
9696
- Apply german translation fixes from Debian team in issue2550761,
9797
thanks to Kai Storbeck for taking the time to report these.
9898
(Ralf Schlatterbeck)
99+
- Fix issue2550843 Pass text of Unauthorised and Login exceptions instead
100+
of the exception instance to avoid traceback with string operations.
101+
(Thomas Arendsen Hein)
99102

100103
Minor:
101104
- demo.py usage message improved: explains "nuke" now. (Bernhard Reiter)

roundup/cgi/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,11 +531,11 @@ def inner_main(self):
531531
"Basic realm=\"%s\"" % realm)
532532
else:
533533
self.response_code = http_.client.FORBIDDEN
534-
self.renderFrontPage(message)
534+
self.renderFrontPage(str(message))
535535
except Unauthorised, message:
536536
# users may always see the front page
537537
self.response_code = 403
538-
self.renderFrontPage(message)
538+
self.renderFrontPage(str(message))
539539
except NotModified:
540540
# send the 304 response
541541
self.response_code = 304

0 commit comments

Comments
 (0)