HTTP getreply() never returns

Marko.Cain.23 at gmail.com Marko.Cain.23 at gmail.com
Fri Apr 20 10:55:35 EDT 2007


On Apr 20, 12:06 am, Steve Holden <s... at holdenweb.com> wrote:
> Marko.Cain... at gmail.com wrote:
> > On Apr 19, 2:39 pm, Steve Holden <s... at holdenweb.com> wrote:
> >> Marko.Cain... at gmail.com wrote:
> >>> Hi,
> >>> I have the following code which send/receive HTTP request/response:
> >>>    # where sampleUrl is '127.0.0.1' and
> >>>    # url is 'www.cnn.com'
> >>>    h = httplib.HTTP(self.sampleUrl, 8080)
> >>>         h.putrequest('GET', '/sample?url=' + self.url)
> >>>         h.endheaders()
> >>>         errcode, errmsg, headers = h.getreply()
> >>> But it never returns from h.getreply().
> >>> I am using python 2.3.4. Can you please tell me what am I missing?
> >>> I am sure the url is correctly. I try putting this 'http://
> >>> 127.0.0.1:8080/sample?url=www.cnn.com'andit works.
> >>> Thank you for any help.
> >[...]
>
> >> For what it's worth you *do* appear to have formed the calls correctly,
> >> so something a little more complex is going on here.
>
> >> You might consider using WireShark (nee Ethereal) to look at the data
> >> passing across the wire when you use the browser and when you use
> >> httplib then comparing the data. That won't work on Windows because it
> >> disobligingly refuses to let you tap into the loopback (127) network.
>
> >> regards
> >>   Steve
>
> > Thanks. I run the same script hits the same server (a tomcat server):
> > One is on Fedora 5 with python 2.4, this works.
> > But one is on Red Hat 4 with python 2.3, this one does not work.
>
> > Can you please tell me how can I make the script works on RHEL 4
> > without upgrading it to python 2.3?
>
> I can't see anything in
>
> http://svn.python.org/view/python/trunk/Lib/httplib.py?rev=54581&view...
>
> that screams it might have fixed a problem. But I'd be tempted to try
> and "borrow" a copy of 2.4's httplib, run your program with that in a
> directory where it will be found before the standard library 2.3 module
> and see if it fixes the problem.
>
> If so, would it be a usable workaround just to use the 2.4 httplib for
> that one program?
>

Thanks. Can you please tell me how can I 'borrow' a copy of 2.4
httplib and run that in 2.3?



> regards
>   Steve
> --
> Steve Holden       +44 150 684 7255  +1 800 494 3119
> Holden Web LLC/Ltd          http://www.holdenweb.com
> Skype: holdenweb    http://del.icio.us/steve.holden
> Recent Ramblings      http://holdenweb.blogspot.com





More information about the Python-list mailing list