By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,715 Members | 748 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,715 IT Pros & Developers. It's quick & easy.

Streaming Data Error in .read() (HTTP/ICY) Possible Bug?

P: n/a
I playing around with streaming shoutcast mp3s.

Here is some sample code:

import httplib

# Put together the headers
headers = {"Icy-MetaData":"1"}

con = httplib.HTTPConnection('', 8000)
con.request("GET", "/")
stream = con.getresponse()
print stream.status,stream.reason

For which i get error:

bash-2.05b$ ./
Traceback (most recent call last):
File "./", line 21, in ?
File "C:\python24\lib\", line 463, in read
s = self._safe_read(self.length)
File "C:\python24\lib\", line 545, in _safe_read
chunk =
File "C:\python24\lib\", line 1273, in read
return s + - len(s))
TypeError: unsupported operand type(s) for -: 'str' and 'int'

It seems somehow amt is turning into a str.

Is this a bug in or there something wrong with my code?
- Haz

Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
I should purhaps mention that i am basically trying to translate this.

nc ~= telnet


nc 9012 <<EOF
GET / HTTP/1.0

Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.