Message220705
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 issue10367 as well), but it can be removed if other solutions are preferable. |
|
Date |
User |
Action |
Args |
2014-06-16 09:33:29 | Claudiu.Popa | set | recipients:
+ Claudiu.Popa, eric.araujo, dstufft |
2014-06-16 09:33:29 | Claudiu.Popa | set | messageid: <1402911209.04.0.940354382674.issue21776@psf.upfronthosting.co.za> |
2014-06-16 09:33:28 | Claudiu.Popa | link | issue21776 messages |
2014-06-16 09:33:28 | Claudiu.Popa | create | |
|