Doesn't work (was: Re: httplib won't accept URL with parameters (???))

pythonhda pythonhda at yahoo.com.replacepythonwithlinux
Wed Jan 8 12:51:05 EST 2003


If you can upgrade go ahead. If you're running redhat 7.x it uses v1.5 (up2date for example) and you *might* mess up your configuration if you upgrade *but* you can install python v2.x with an executable name "python2" (that's what the v2.2.1 RPMs did for me). 

Now about the HTTP class. I only have it to be backwards compatible with v1.5 (that's what __doc__ string says). There's no mention of it in my library reference. So what *I* would do is upgrade to 2.2.x making sure that it won't screw up my installation and then use the HTTPConnection class becuase that is what is in use now.

You could also take a look at your current documentation to see if you're doing something wrong.

I hope that helps.


On Wed, 8 Jan 2003 13:18:10 +0100
Phillip <ritschratsch at gmx.de> wrote:

> pythonhda wrote:
> 
> > I'm using python 2.2.1
> > This works for me...I get the source of the page:
>  
> > import httplib
> > 
> > USER_AGENT = "Navigator"
> > 
> > 
> > class ServerGet:
> > 
> >     def __init__(self, host):
> >         self.host = host
> >         
> >     def fetch(self, path):
> >         http = httplib.HTTP(self.host)
> > 
> >         # write header
> >         http.putrequest("GET", path)
> >         http.putheader("User-Agent", USER_AGENT)
> >         http.putheader("Host", self.host)
> >         http.putheader("Accept", "*/*")
> >         http.endheaders()
> >         
> >         # get response
> >         errcode, errmsg, headers = http.getreply()
> > 
> >         
> >         file = http.getfile()
> >         data = file.read()
> >         http.close()
> >         return data
> 
> > Maybe our versions conflict? Check section 11.6.2 in the library
> > reference. It is a little different from your version. I believe you're
> > using an antiquated class "HTTP". The doc string for *me* says:
> > 'Compatibility class with httplib.py from 1.5.'. So not being microsoft, I
> > won't say "Upgrade!" :) - We're probably not speaking the same version...
> 
> I'm supecting the same since last evening. From how I interpret you I just 
> need to upgrade and the same class should run, yes? Or is there something 
> else to do with that new httpConnect class?
> Anyway, I'll get the latest Python and tell you how it turned out. Thanks 
> for the help!
> 
> -- 
> Phillip




More information about the Python-list mailing list