This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Claudiu.Popa
Recipients Claudiu.Popa, dstufft, eric.araujo
Date 2014-06-16.09:33:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Hi. Currently, distutils.command.upload has this code:

    result = urlopen(request)
    status = result.getcode()
    reason = result.msg
except OSError as e:
    self.announce(str(e), log.ERROR)
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 issue10367 as well), but it can be removed if other solutions are preferable.
Date User Action Args
2014-06-16 09:33:29Claudiu.Popasetrecipients: + Claudiu.Popa, eric.araujo, dstufft
2014-06-16 09:33:29Claudiu.Popasetmessageid: <>
2014-06-16 09:33:28Claudiu.Popalinkissue21776 messages
2014-06-16 09:33:28Claudiu.Popacreate