[Python-bugs-list] [Bug #119556] Python 2.0 httplib doesn't like ICY status lines

noreply@sourceforge.net noreply@sourceforge.net
Sun, 29 Oct 2000 09:57:18 -0800


Bug #119556, was updated on 2000-Oct-27 10:24
Here is a current snapshot of the bug.

Project: Python
Category: Library
Status: Open
Resolution: None
Bug Group: None
Priority: 5
Summary: Python 2.0 httplib doesn't like ICY status lines

Details: 
I have a Python script that captures streaming audio on the Internet.
The homepage is at http://beam-back.sourceforge.net  It works fine
with Python 1.5.2 and Python 1.6.  One of my users noticed the script
is broken under Python 2.0.

In the getreply function of httplib.py in Python 1.5.2, even if 
ver[:5] != 'HTTP/', the connection is left open.  I depend on this 
behavior because streaming audio links found at 
http://www.shoutcast.com/ return a status line like this:

ICY 200 OK

Under Python 1.6 and 1.5.2, I can happily go on and use getfile() to
obtain the data on the connection.

In the getreply function of httplib.py in Python 2.0, the BadStatusLine
exception (raised by ver[:5] != 'HTTP/' in begin) causes the connection
to be closed.

I'm writing to find out how I could go about discussing a possible
return to the previous behavior in future releases of Python.  If
that is not feasible, I would be appreciative of any advice on how
I should go about porting the script to Python 2.0.

Regards,
--Kal




Follow-Ups:

Date: 2000-Oct-28 18:12
By: loewis

Comment:
The response of the server clearly violates RFC 2616, section 6.1. Where is the documentation for the protocol that this server implements? If you need to support this protocol (which clearly is not HTTP), you need to implement your own response class (perhaps inheriting from HTTPResponse if possible).
-------------------------------------------------------

For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=119556&group_id=5470