• Jeremy Hylton's avatar
    Fix urllib2.urlopen() handling of chunked content encoding. · 5d9c3031
    Jeremy Hylton yazdı
    The change to use the newer httplib interface admitted the possibility
    that we'd get an HTTP/1.1 chunked response, but the code didn't handle
    it correctly.  The raw socket object can't be pass to addinfourl(),
    because it would read the undecoded response.  Instead, addinfourl()
    must call HTTPResponse.read(), which will handle the decoding.
    
    One extra wrinkle is that the HTTPReponse object can't be passed to
    addinfourl() either, because it doesn't implement readline() or
    readlines().  As a quick hack, use socket._fileobject(), which
    implements those methods on top of a read buffer.  (suggested by mwh)
    
    Finally, add some tests based on test_urllibnet.
    
    Thanks to Andrew Sawyers for originally reporting the chunked problem.
    5d9c3031
Adı
Son kayıt (commit)
Son güncelleme
Demo Loading commit data...
Doc Loading commit data...
Grammar Loading commit data...
Include Loading commit data...
Lib Loading commit data...
Mac Loading commit data...
Misc Loading commit data...
Modules Loading commit data...
Objects Loading commit data...
PC Loading commit data...
PCbuild Loading commit data...
Parser Loading commit data...
Python Loading commit data...
RISCOS Loading commit data...
Tools Loading commit data...
.cvsignore Loading commit data...
.hgtags Loading commit data...
LICENSE Loading commit data...
Makefile.pre.in Loading commit data...
README Loading commit data...
aclocal.m4 Loading commit data...
configure Loading commit data...
configure.in Loading commit data...
install-sh Loading commit data...
pyconfig.h.in Loading commit data...
setup.py Loading commit data...