Rolf Krahl added the comment:

I'd like to support the request.  I have a use case where I definitely need 
this feature: I maintain a Python client for a scientific metadata catalogue, 
see [1] for details.  The client also features the upload of the data files.  
The files may come in as a data stream from another process, so my client takes 
a file like object as input.  The files may be large (several GB), so buffering 
them is not an option, they must get streamed to the server as they come in.  
Therefore, there is have no way to know the Content-length of the upload 
beforehand.

I implemented chunked transfer encoding in a custom module that monkey patches 
the library, see the attached file.  This works fine, but of course it's an 
awkward hack as I must meddle deeply into the internals of urllib and 
http.client to get this working.  This module is tested to work with Python 
2.7, 3.1, 3.2, 3.3, and 3.4 (for Python 3 you need to pass it through 2to3 
first).  I really would like to see this feature in the standard library in 
order to get rid of this hack in my package.  I would happy to transform my 
module into a patch to the library if such a patch would have a chance to get 
accepted.

[1]: https://code.google.com/p/icatproject/wiki/PythonIcat

----------
nosy: +Rotkraut
Added file: http://bugs.python.org/file36493/chunkedhttp.py

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12319>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to