This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Python 2.0 httplib doesn't like ICY status lines
Type: Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: jhylton Nosy List: jhylton, kal, loewis
Priority: normal Keywords:

Created on 2000-10-27 17:24 by kal, last changed 2022-04-10 16:02 by admin. This issue is now closed.

Messages (3)
msg2197 - (view) Author: Kal Lin (kal) Date: 2000-10-27 17:24
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


msg2198 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2000-10-29 01:12
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).
msg2199 - (view) Author: Kal Lin (kal) Date: 2000-10-30 21:31
As far as I know, there is no published doc for the protocol.
I'm working from the xmms source code and just trial and error.
You're right.  I should write a new response class for supporting 
ICY instead of latching onto httplib.

Thanks.


History
Date User Action Args
2022-04-10 16:02:32adminsetgithub: 33406
2000-10-27 17:24:07kalcreate