File "in3sun34.py", line 33, in AttributeError: HTTPConnection

Piet van Oostrum piet at cs.uu.nl
Tue Jun 25 07:32:27 EDT 2002


>>>>> Guillermo Fernandez <guillermo.fernandez at epfl.ch> (GF) writes:

GF> Hello!
GF> Please, if you answer me, include my e-mail in the answer as I am not
GF> abonned to this mailing list.

GF> I've written a little program to test python (I'm a beginner). Here it
GF> is:

GF> import httplib

GF> conn = httplib.HTTPConnection("www.python.org")
GF> print "CONNECTED"
GF> conn.request("GET", "/index.html
GF> response=conn.getresponse()
GF> answer=response.read()
GF> conn.close()
GF> print answer

GF> When I execute it, I obtain an error:
GF> [112]host-cfernand% python test.py
GF> Traceback (innermost last):
GF>   File "test.py", line 3, in ?
GF>     conn = httplib.HTTPConnection("www.python.org")
GF> AttributeError: HTTPConnection

GF> Line number 3 is:
GF> conn = httplib.HTTPConnection("www.python.org")

Supposing the ^X^S are not really in your file, this program should work
(I just tried it). Maybe you have a private httplib.py file somewhere in
your Python path.
-- 
Piet van Oostrum <piet at cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP]
Private email: P.van.Oostrum at hccnet.nl



More information about the Python-list mailing list