projects
/
python
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7a666b8
)
cope with weird Content-Length values returned from servers by
author
Jeremy Hylton
<jeremy@alum.mit.edu>
Thu, 14 Sep 2000 20:34:27 +0000
(20:34 +0000)
committer
Jeremy Hylton
<jeremy@alum.mit.edu>
Thu, 14 Sep 2000 20:34:27 +0000
(20:34 +0000)
ignoring them; e.g. Zope sometimes returns 13497L
Lib/httplib.py
patch
|
blob
|
history
diff --git
a/Lib/httplib.py
b/Lib/httplib.py
index eac59e38b03273ffb6c3dcf7e3d912b696142ae7..1fe358e0b947effd4bbc514958a3b6859d234afd 100644
(file)
--- a/
Lib/httplib.py
+++ b/
Lib/httplib.py
@@
-166,7
+166,10
@@
class HTTPResponse:
# NOTE: RFC 2616, S4.4, #3 says we ignore this if tr_enc is "chunked"
length = self.msg.getheader('content-length')
if length and not self.chunked:
- self.length = int(length)
+ try:
+ self.length = int(length)
+ except ValueError:
+ self.length = None
else:
self.length = None