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.

classification
Title: HTTPResponse instance has no attribute 'code'
Type: Stage:
Components: Library (Lib) Versions: Python 2.4
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: nnorwitz, yodalf
Priority: normal Keywords:

Created on 2006-06-16 09:32 by yodalf, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg28810 - (view) Author: yodalf (yodalf) Date: 2006-06-16 09:32
I get this error :
Traceback (most recent call last):
  File "ogbot.py", line 247, in ?
    main()
  File "ogbot.py", line 89, in main
    handle = urlopen(req)
  File "/usr/lib/python2.4/urllib2.py", line 130, in
urlopen
    return _opener.open(url, data)
  File "/usr/lib/python2.4/urllib2.py", line 364, in open
    response = meth(req, response)
  File "/usr/lib/python2.4/urllib2.py", line 468, in
http_response
    code, msg, hdrs = response.code, response.msg,
response.info()
AttributeError: HTTPResponse instance has no attribute
'code'

When I use 
req =
Request("http://some/url.php?session=%s"%(session),
data, headers)
handle = urlopen(req)

msg28811 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2006-06-17 05:50
Logged In: YES 
user_id=33168

Can you attach a file with a complete python program that
demonstrates this problem?  Thanks.
msg28812 - (view) Author: yodalf (yodalf) Date: 2006-06-17 07:54
Logged In: YES 
user_id=1278568

Sorry,
The problem came from an external module (urlgrabber) which
aparently was not up to date.
History
Date User Action Args
2022-04-11 14:56:18adminsetgithub: 43513
2006-06-16 09:32:39yodalfcreate