[docs] [issue13211] urllib2.HTTPError does not have 'reason' attribute.
Jason R. Coombs
report at bugs.python.org
Mon Nov 7 22:38:14 CET 2011
Jason R. Coombs <jaraco at jaraco.com> added the comment:
My initial instinct was to agree - the status code is useful. However, in looking at the FTP code, it sometimes just sets other objects (socket.error for example) as the 'reason'. The docs say 'reason' is a string or another exception.
I'm tempted to leave it as is. This fix is mainly to provide a reasonable value for .reason. The __str__ and .code are already exposed, so to create a reason with a code would create yet another string representation of the error which is different from every other representation already present.
Python tracker <report at bugs.python.org>
More information about the docs