[issue2585] urllib2.HTTPError broken due to urllib.addinfourl changes

djc report at bugs.python.org
Tue Apr 8 17:19:25 CEST 2008


New submission from djc <dirkjan at ochtman.nl>:

djc at enrai tests $ python2.6
Python 2.6a2+ (trunk, Apr  4 2008, 20:21:45)
[GCC 4.1.2 20070214 (  (gdc 0.24, using dmd 1.020)) (Gentoo 4.1.2
p1.0.2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib2
>>> try:
...     urllib2.urlopen('http://example.com/weird')
... except urllib2.HTTPError, inst:
...     print inst.code
...
None
>>>

urllib.addinfourl.__init__() was changed in r60133 to set self.code.
Unfortunately, this overrides HTTPError.code, which is probably not good.

----------
components: Library (Lib)
messages: 65168
nosy: birkenfeld, djc
severity: normal
status: open
title: urllib2.HTTPError broken due to urllib.addinfourl changes
versions: Python 2.6

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2585>
__________________________________


More information about the Python-bugs-list mailing list