[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2015-05-21 Thread Demian Brecht

Demian Brecht added the comment:

Thanks for the report Rolf. I'll look into your suggestion for this patch.

Antoine: Given beta is slated for the 24th and Martin's legitimate concerns, I 
think it might be a little hasty to get this in before feature freeze. Knocking 
it back to 3.6 (obviously feel free to change if you think it should remain for 
any reason).

--
versions: +Python 3.6 -Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2015-05-21 Thread Rolf Krahl

Rolf Krahl added the comment:

Hi again,

first of all, sorry for not contributing to the discussion for such a long 
time.  I was quite busy lately.

I tested the patch with Python 3.5.0a3.  It works nicely for my use case.  
Thanks a lot!

I have one issue though: urllib's HTTPHandler and HTTPSHandler still try to 
enforce a Content-length to be set (by AbstractHTTPHandler.do_request_()).  But 
for chunked transfer encoding, the Content-length must not be set.  Using to 
this patch, HTTPConnection also checks for the Content-length in 
_send_request() and sets it if missing.  AFAICS, HTTPConnection now does a far 
better job checking this then HTTPHandler and - most importantly - does it in a 
way that is compatible with chunked transfer encoding.  So, I would suggest, 
that there is no need for HTTPHandler to care about the content length and that 
it should just leave this header alone.

E.g., I suggest that the "if not request.has_header('Content-length'): [...]" 
statement should completely be removed from AbstractHTTPHandler.do_request_() 
in urllib/request.py.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2015-05-21 Thread Martin Panter

Martin Panter added the comment:

I left some new comments.

However I remain concerned at how complicated and overloaded the API is 
becoming. It certainly makes it hard to review for correctness. I could easily 
have missed some corner case that is broken by the changes. There are a lot of 
odd body objects apparently permitted, e.g. GzipFile objects can always seek to 
the end but may not be able to go backwards, mmap() objects are both bytes-like 
and file-like.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2015-05-20 Thread Demian Brecht

Demian Brecht added the comment:

BTW, thanks for the reviews Martin and the nudge Antoine!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2015-05-20 Thread Demian Brecht

Demian Brecht added the comment:

Latest patch should address all outstanding comments.

--
Added file: http://bugs.python.org/file39447/issue12319_6.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2015-05-19 Thread Demian Brecht

Demian Brecht added the comment:

> What's the status on this one? It looks like some review comments need 
> addressing.

That's about it. Unfortunately I've been pretty tied up over the last month and 
a bit. I'll try to get to hopefully closing this out over the next few days.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2015-05-18 Thread Antoine Pitrou

Antoine Pitrou added the comment:

What's the status on this one? It looks like some review comments need 
addressing.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2015-04-01 Thread Demian Brecht

Changes by Demian Brecht :


Added file: http://bugs.python.org/file38797/issue12319_5.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2015-04-01 Thread Martin Panter

Martin Panter added the comment:

The incremental improvement thing sounds good. Here are some things which I 
think are orthogonal to sensible chunked encoding:

* Automagic seeking to determine Content-Length
* Setting Content-Length for iterables that are neither strings, iterators nor 
files (Issue 23350)
* Latin-1 encoding of iterated items

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2015-03-31 Thread Demian Brecht

Demian Brecht added the comment:

Agreed. However, I'm wondering if that should belong in a new issue geared 
towards further clarifying behaviour of request body types. The patch 
introduces the behaviour this specific issue was looking, with the largest 
change being that iterators may now result in chunked transfer encoding with 
the data currently handled by the library. I'd rather move forward with 
incremental improvements rather than keep building on each issue before the 
work's merged (there's still a /good/ amount of work to be done in this module).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2015-03-31 Thread Martin Panter

Martin Panter added the comment:

Perhaps you should make a table of some potential body object types, and figure 
out what the behaviour should be for request() with and without relevant 
headers, and endheaders() and send() with and without encode_chunked=True:

* Add/don’t add Content-Length/Transfer-Encoding
* Send with/without chunked encoding
* Raise exception
* Not supported or undefined behaviour

Potential body types:

* None with GET/POST request
* bytes()
* Latin-1/non Latin-1 str()
* BytesIO/StringIO
* Ordinary binary/Latin-1/other file object
* File object reading a special file like a pipe (st_size == 0)
* File object wrapping a pipe or similar that does not support fileno() (ESPIPE)
* Custom file object not supporting fileno() nor seeking
* File object at non-zero offset
* GzipFile object, where fileno() corresponds to the compressed size
* GzipFile not supporting fileno(), where seeking is possible but expensive
* Iterator yielding bytes() and/or strings
* Generator
* File object considered as an iterable of lines
* List/tuple of bytes/text
* Other sequences of bytes/text
* Other iterables of bytes/text, e.g. set(), OrderedDict.values()

This list could go on and on. I would rather have a couple of simple rules, or 
explicit APIs for the various modes so you don’t have to guess which mode your 
particular body type will trigger.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2015-03-31 Thread Demian Brecht

Changes by Demian Brecht :


Added file: http://bugs.python.org/file38772/issue12319_4.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2015-03-24 Thread Demian Brecht

Demian Brecht added the comment:

Thanks for the review Martin.

> However I understand Rolf specifically wanted chunked encoding to work with 
> the existing urlopen() framework, at least after constructing a separate 
> opener object. I think that should be practical with the existing 
> HTTPConnection implementation.

The original issue was that http.client doesn't support chunked encoding. With 
this patch, chunked encoding should more or less come for free with urlopen. 
There's absolutely no reason as to why HTTPConnection should not support 
transfer encoding out of the box given it's part of the HTTP1.1 spec. I do 
understand that there are some modifications needed in urllib.request in order 
to support the changes here, but I didn't include those in the patch as to not 
conflate the patch. I think that it's also reasonable to open a new issue to 
address the feature in urllib.request rather than piggy-backing on this one.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2015-03-24 Thread Demian Brecht

Changes by Demian Brecht :


Added file: http://bugs.python.org/file38670/issue12319_3.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2015-03-24 Thread Martin Panter

Martin Panter added the comment:

I left a few comments on Reitveld, mainly about the documentation and API 
design.

However I understand Rolf specifically wanted chunked encoding to work with the 
existing urlopen() framework, at least after constructing a separate opener 
object. I think that should be practical with the existing HTTPConnection 
implementation. Here is some pseudocode of how I might write a urlopen() 
handler class, and an encoder class that should be usable for both clients and 
servers:

class ChunkedHandler(...):
def http_request(...):
# Like AbstractHTTPHandler, but don’t force Content-Length

def default_open(...):
# Like AbstractHTTPHandler, but instead of calling h.request():
encoder = ChunkedEncoder(h.send)
h.putrequest(req.get_method(), req.selector)
for item in headers:
h.putheader(*item)
h.putheader("Transfer-Encoding", encoder.encoding)
h.endheaders()
shutil.copyfileobj(req.data, writer)
encoder.close()

class ChunkedEncoder(io.BufferedIOBase):
# Hook output() up to either http.client.HTTPConnection.send()
# or http.server.BaseHTTPRequestHandler.wfile.write()

encoding = "chunked"

def write(self, b):
self.output("{:X}\r\n".format(len(b)).encode("ascii"))
self.output(b)
self.output(b"\r\n")

def close(self):
self.output(b"0\r\n\r\n")

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2015-03-17 Thread Demian Brecht

Demian Brecht added the comment:

Updated patch changes the following:

+ Removes support for trailers in requests as they're not supported
+ If Transfer-Encoding is explicitly set by the client, it's assumed that the 
caller will handle all encoding (backwards compatibility)
+ Fixed a bug where chunk size was being sent as decimal instead of hex

--
Added file: http://bugs.python.org/file38528/issue12319_2.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2015-03-07 Thread Demian Brecht

Demian Brecht added the comment:

After sleeping on this, I think that the best route to go would be to drop the 
trailer implementation (if it's not practical it doesn't belong in the standard 
library).

Also, to better preserve backwards compatibility it may be better to circumvent 
the automatic chunking if transfer-encoding headers are present in the request 
call. That way, no changes would need to be made to existing code that already 
supports it at a higher level.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2015-03-06 Thread Demian Brecht

Demian Brecht added the comment:

FWIW, so far I've tested this change against:

cherrypy 3.6.0
uwsgi 2.0.9 (--http-raw-body)
nginx 1.6.2 (chunked_transfer_encoding on, proxy_buffering off;) + uwsgi 2.0.9 
(--http-raw-body)

The chunked body works as expected. Unfortunately, all implementations seem to 
be ignorant of the trailer part. So it seems that although RFC-compliant (and I 
can definitely see the use case for it), they trailer implementation may not be 
overly practical. I still think that it's worthwhile keeping it, but perhaps 
adding a note that it may not be supported at this point.

Relevant gists: https://gist.github.com/demianbrecht/3fd60994eceeb3da8f13

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2015-03-05 Thread Demian Brecht

Changes by Demian Brecht :


Added file: http://bugs.python.org/file38352/issue12319_1.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2015-03-05 Thread Demian Brecht

Demian Brecht added the comment:

Also note that this patch includes the changes in #23350 as it's directly 
relevant.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2015-03-05 Thread Demian Brecht

Changes by Demian Brecht :


--
versions: +Python 3.5 -Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2015-03-05 Thread Demian Brecht

Demian Brecht added the comment:

I hit "submit" a little too soon.

The intention of the patch is to adhere to all aspects of Transfer-Encoding as 
specified in the RFC and to make best guesses as to encoding that should be 
used based on the data type of the given body.

This will break backwards compatibility for cases where users are manually 
chunking the request bodies prior to passing them in and explicitly setting the 
Transfer-Encoding header. Additionally, if Transfer-Encoding was previously 
specified, but not chunked, the patch will automatically chunk the body.

Otherwise, the patch should only be additive.

--
keywords: +needs review, patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file38351/issue12319.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2015-03-05 Thread Demian Brecht

Demian Brecht added the comment:

I've attached a patch that implements full Transfer-Encoding support for 
requests as specified in RFC 7230.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2015-02-15 Thread Rolf Krahl

Rolf Krahl added the comment:

The design goal for my implementation was compatibility.  My version can be 
used as a drop in replacement for the existing urllib's HTTPHandler.  The only 
thing that need to be changed in the calling code is that it must call 
build_opener() to select the chunked handler in the place of the default 
HTTPHandler.  After this, the calling code can use the returned opener in the 
very same way as usual.

I guess, switching to a push interface would require major changes in the 
calling code.  

In principle, you could certainly support both schemes at the same time: you 
could change the internal design to a push interface and than wrap this by a 
pull interface for the compatibility with existing code.  But I'm not sure 
whether this would be worth the effort.  If, as Piotr suggests, the current 
urllib is going to be replaced by urllib3, then I guess, its questionable if it 
makes sense to add  major design changes that are incompatible with existing 
code to the current standard lib.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2015-02-14 Thread Martin Panter

Martin Panter added the comment:

One interesting question is how to convey data to the chunked encoder. There 
are two sets of options in my mind, a pull interface:

* iterable: seems to be the popular way amoung commenters here
* file reader object: encoder calls into stream’s read() method

and a push interface:

* chunked encoder is a file writer object: user calls encoder’s write() and 
close() methods. This would suit APIs like saxutils.XMLGenerator and 
TextIOWrapper.
* chunked encoder has a “feed parser” interface, codecs.IncrementalEncoder 
interface, or something else.

The advantage of the push interface is that you could fairly easily feed data 
from an iterable or file reader into it simply by just doing 
shutil.copyfileobj() or equivalent. But to adapt the pull interface to a push 
interface would require “asyncio” support or a separate thread or something to 
invert the flow of control. So I think building the encoder with a push 
interface would be best. Rolf’s ChunkedHTTPConnectionMixin class appears to 
only support the pull interface (iterables and stream readers).

I would welcome support for chunked uploading in Python’s “http.client” module, 
especially with push or stream writer support. I don’t think overwriting 
_send_request should be necessary; just call putrequest(), putheader() etc 
manually, and then call send() for each chunk. Perhaps there is scope for 
sharing the code with the “http.server” module (for encoding chunked responses).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2014-08-29 Thread Martin Panter

Changes by Martin Panter :


--
nosy: +vadmium

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2014-08-28 Thread Rolf Krahl

Rolf Krahl added the comment:

Thanks for the notice!  As far as I read from the link you cite, getting rid of 
the current httplib in urllib3 is planned but far from being done.  
Furthermore, I don't like packages with too many 3rd party dependencies.  Since 
my package is working fine with the current standard lib, even though using an 
ugly hack in one place, I'd consider switching to urllib3 as soon as the latter 
makes it into the standard lib.

I still believe that adding chunked transfer encoding to http.client and urllib 
in the current standard lib would only require a rather small change that can 
easily be done such that the lib remains fully compatible with existing code.  
Still waiting for feedback if such a patch is welcome.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2014-08-28 Thread Piotr Dobrogost

Piotr Dobrogost added the comment:

@Rotkraut

The truth is http in stdlib is dead.
Your best option is to use 3rd party libs like requests or urllib3.
Authors of these libs plan to get rid of httplib entirely; see "Moving away 
from httplib" (https://github.com/shazow/urllib3/issues/58)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2014-08-28 Thread Rolf Krahl

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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2014-07-25 Thread Demian Brecht

Changes by Demian Brecht :


--
nosy: +demian.brecht

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2014-07-25 Thread Adam Tauno Williams

Changes by Adam Tauno Williams :


--
nosy: +whitemice

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2012-10-10 Thread Piotr Dobrogost

Changes by Piotr Dobrogost :


--
nosy: +piotr.dobrogost

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2012-09-25 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> We had support for chunked transfer encoding for POST method recently, 
> which is exposed via urllib2 wrapper function.

I couldn't find what you're talking about.
If I look at AbstractHTTPHandler.do_request_, it actually mandates a 
Content-Length header for POST data (hence no chunked encoding).

--
nosy: +pitrou

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2011-06-20 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

We had support for chunked transfer encoding for POST method recently, which is 
exposed via urllib2 wrapper function. PUT is not exposed via urllib2 and users 
should use httplib. This feature of chunked transfer can be added to PUT by 
taking the body of the message as iterable.

--
assignee:  -> orsenthil
stage:  -> needs patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2011-06-15 Thread harobed

harobed  added the comment:

> Now I'm confused. Per the HTTP specification, GET requests don't have
a body, so "Transfer-Encoding: chunked" doesn't apply to them.

> Are you sure you don't confuse with the response that the server
sends? In responses, "Transfer-Encoding: chunked" is very common.

Sorry, yes GET requests have "Transfer-Encoding: chunked" in server response.
PUT requests can send body data in transfer-encoding chunked mode.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2011-06-14 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +orsenthil

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2011-06-13 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

harobed wrote:
> I use http.client in WebDAV client.
>
> Mac OS X Finder WebDAV client perform all his request in "chunk" mode : PUT 
> and GET.
>
> Here, I use http.client to simulate Mac OS X Finder WebDAV client.

Now I'm confused. Per the HTTP specification, GET requests don't have
a body, so "Transfer-Encoding: chunked" doesn't apply to them.

Are you sure you don't confuse with the response that the server
sends? In responses, "Transfer-Encoding: chunked" is very common.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2011-06-13 Thread harobed

harobed  added the comment:

I use http.client in WebDAV client.

Mac OS X Finder WebDAV client perform all his request in "chunk" mode : PUT and 
GET.

Here, I use http.client to simulate Mac OS X Finder WebDAV client.

Regards,
Stephane

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2011-06-13 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

What's the use case? Do you have an iterable that yields data whose size is 
unknown?

AFAIK, most web servers don't even support chunked uploads.

(Removing Python 2.7 from versions as this is clearly a feature request.)

--
nosy: +petri.lehtinen
type:  -> feature request
versions:  -Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2011-06-12 Thread harobed

New submission from harobed :

Hi,

HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data.

Exemple, I can't do PUT request with chunk transfert.

Regards,
Stephane

--
components: Library (Lib)
messages: 138203
nosy: harobed
priority: normal
severity: normal
status: open
title: [http.client] HTTPConnection.putrequest not support "chunked" 
Transfer-Encodings to send data
versions: Python 2.7, Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com