You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2016-06-02.20:43:12.589>created_at=<Date2014-06-16.09:33:28.987>labels= ['type-bug', 'library']
title='distutils.upload uses the wrong order of exceptions'updated_at=<Date2016-06-02.20:43:12.588>user='https://github.com/PCManticore'
Hi. Currently, distutils.command.upload has this code:
try:
result = urlopen(request)
status = result.getcode()
reason = result.msg
except OSError as e:
self.announce(str(e), log.ERROR)
return
except HTTPError as e:
status = e.code
reason = e.msg
This is wrong because HTTPError is a subclass of OSError and OSError branch will be chosen in case HTTPError is raised. The HTTPError branch was added in 4373f0e4eb21, but after a while socket.error became an alias for OSError, as well for HTTPError. This patch also adds a return in order to prevent an UnboundLocalError (found in bpo-10367 as well), but it can be removed if other solutions are preferable.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: