Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: httplib raises ValueError reading chunked content

Reply
Thread Tools

Re: httplib raises ValueError reading chunked content

 
 
Philip Semanchuk
Guest
Posts: n/a
 
      03-09-2006

On Mar 8, 2006, at 8:32 PM, Etienne Desautels wrote:

>
> Hi Philip,
>
>> Hi all,
>> Has anyone ever seen Python 2.4.1's httplib choke when reading chunked
>> content?

>
> Yes, it's a know bug. See for yourself:
> https://sourceforge.net/tracker/?
> func=detail&atid=305470&aid=900744&group_id=5470


Merci beaucoup Etienne, I don't know why I couldn't find that in the
bug list. I will have to work on my searching skills.

Cheers
Philip



>
> Etienne
>
>> I'm using it via urrlib2, and I ran into a particular server
>> that returns something that httplib doesn't expect. Specifically, in
>> the code below where the error occurs, line == ''.
>>
>> Python 2.4.1 (#2, Oct 12 2005, 01:36:32)
>> [GCC 3.4.4 [FreeBSD] 20050518] on freebsd6
>> Type "help", "copyright", "credits" or "license" for more information.
>>>>> import urllib2
>>>>> req = urllib2.Request("http://www.mistyshaven.com/")
>>>>> f = urllib2.urlopen(req)
>>>>> content = f.read()

>> Traceback (most recent call last):
>> File "<stdin>", line 1, in ?
>> File "/usr/local/lib/python2.4/socket.py", line 285, in read
>> data = self._sock.recv(recv_size)
>> File "/usr/local/lib/python2.4/httplib.py", line 456, in read
>> return self._read_chunked(amt)
>> File "/usr/local/lib/python2.4/httplib.py", line 495, in
>> _read_chunked
>> chunk_left = int(line, 16)
>> ValueError: invalid literal for int():

>
>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: socket.makefile raises ValueError when mode = 'rt' Terry Reedy Python 0 01-09-2013 11:36 PM
Re: socket.makefile raises ValueError when mode = 'rt' Antoon Pardon Python 0 01-09-2013 02:14 PM
Re: socket.makefile raises ValueError when mode = 'rt' Dave Angel Python 0 01-09-2013 01:54 PM
socket.makefile raises ValueError when mode = 'rt' Antoon Pardon Python 0 01-09-2013 01:22 PM
httplib raises ValueError reading chunked content philip20060308@gmail.com Python 0 03-08-2006 11:21 PM



Advertisments