You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Under certain conditions (I'm trying to open a
Shoutcast stream), I wind up with the following
exception from httplib:
Traceback (most recent call last):
File "/home/devel/lib/python2.4/threading.py", line
442, in __bootstrap
self.run()
File "avalanche.py", line 86, in run
streamData = streamResponse.read(256)
File "/home/devel/lib/python2.4/httplib.py", line
478, in read
self.length -=len(s)
TypeError: unsupported operand type(s) for -=: 'str'
and 'int'
Normally, self.length has many shields of the form "if
self.length is None:"; however, self.length gets
initialize to _UNKNOWN which is the string "UNKNOWN"
rather than None. As such, all of the shields are useless.
Am I using a deprecated library or something? I'm
really surprised no one else has bumped into this.
I did bump into the same problem.
Apparently when I got HTTP/0.9 connection, self.length is
not initialized.
Inserting a line into l.362 at httplib.py (v2.4) seems to
solve this problem. I will also post a patch:
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: