• Martin Panter's avatar
    Issue #12319: Support for chunked encoding of HTTP request bodies · 3c0d0baf
    Martin Panter yazdı
    When the body object is a file, its size is no longer determined with
    fstat(), since that can report the wrong result (e.g. reading from a pipe).
    Instead, determine the size using seek(), or fall back to chunked encoding
    for unseekable files.
    
    Also, change the logic for detecting text files to check for TextIOBase
    inheritance, rather than inspecting the “mode” attribute, which may not
    exist (e.g. BytesIO and StringIO).  The Content-Length for text files is no
    longer determined ahead of time, because the original logic could have been
    wrong depending on the codec and newline translation settings.
    
    Patch by Demian Brecht and Rolf Krahl, with a few tweaks by me.
    3c0d0baf
Adı
Son kayıt (commit)
Son güncelleme
.github 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...
Programs Loading commit data...
Python Loading commit data...
Tools Loading commit data...
.bzrignore Loading commit data...
.gitignore Loading commit data...
.hgeol Loading commit data...
.hgignore Loading commit data...
.hgtags Loading commit data...
.hgtouch Loading commit data...
LICENSE Loading commit data...
Makefile.pre.in Loading commit data...
README Loading commit data...
aclocal.m4 Loading commit data...
config.guess Loading commit data...
config.sub Loading commit data...
configure Loading commit data...
configure.ac Loading commit data...
install-sh Loading commit data...
pyconfig.h.in Loading commit data...
setup.py Loading commit data...