Title: HTTPResponse instance has no attribute 'code'
Type: behavior Stage:
Components: Library (Lib) Versions: Python 2.4, Python 2.5
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: Nosy List: jbperez, terry.reedy
Priority: normal Keywords:

Created on 2008-11-02 14:57 by jbperez, last changed 2008-11-08 17:28 by benjamin.peterson. This issue is now closed.

Messages (2)
msg75455 - (view) Author: Jon Perez (jbperez) Date: 2008-11-02 14:57
In http_response() in HTTPErrorProcessor in, the following line

code, msg, hdrs = response.code, response.msg,

results in an error because response.code is not a valid
attribute, changing it to response.status works, but is
this the correct bug fix?


Traceback (most recent call last):
File "/usr/bin/yum", line 30, in <module>
File "/usr/share/yum/", line 233, in main
clientStuff.get_package_info_from_servers(serverlist, HeaderInfo)
File "/usr/share/yum/", line 846, in
File "/usr/share/yum/", line 1327, in grab
bandwidth, conf.retries, retrycodes, checkfunc)
File "/usr/share/yum/", line 237, in retrygrab
progress_obj, throttle, bandwidth)
File "/usr/share/yum/", line 314, in urlgrab
fo = urllib2.urlopen(url)
File "/usr/lib/python2.5/", line 121, in urlopen
return, data)
File "/usr/lib/python2.5/", line 380, in open
response = meth(req, response)
File "/usr/lib/python2.5/", line 487, in http_response
code, msg, hdrs = response.code, response.msg,
AttributeError: HTTPResponse instance has no attribute 'code'
msg75616 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2008-11-07 21:01
This appears to be a duplicate of #1507166, with essentially the same
title.  I found it by searching all issues for "response.code
HTTPResponse".  That was closed because "The problem came from an
external module (urlgrabber) which aparently was not up to date."
Date User Action Args
2008-11-08 17:28:12benjamin.petersonsetstatus: open -> closed
2008-11-08 17:27:55benjamin.petersonsetstatus: pending -> open
2008-11-07 21:01:13terry.reedysetstatus: open -> pending
resolution: duplicate
messages: + msg75616
nosy: + terry.reedy
2008-11-07 20:47:47terry.reedylinkissue4249 superseder
2008-11-02 14:57:16jbperezcreate