Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1999)

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

Can't Edit
Can't Publish+Mail
Start Review
Created:
2 years, 7 months ago by stephane
Modified:
1 year, 1 month ago
Reviewers:
vadmium+py, demianbrecht, pitrou, rolf, ghost.adh
CC:
orsenthil, AntoinePitrou, haypo, stephane_harobed.org, devnull_psf.upfronthosting.co.za, Petri Lehtinen, Martin Panter, piotr.dobrogost, eryksun, demian, matrixise, awilliam_whitemice.org, Rotkraut
Visibility:
Public.

Patch Set 1 #

Patch Set 2 #

Patch Set 3 #

Total comments: 23

Patch Set 4 #

Total comments: 30

Patch Set 5 #

Total comments: 27

Patch Set 6 #

Total comments: 10

Patch Set 7 #

Total comments: 13

Patch Set 8 #

Total comments: 65

Patch Set 9 #

Total comments: 16

Patch Set 10 #

Total comments: 32

Patch Set 11 #

Total comments: 8

Patch Set 12 #

Total comments: 3

Patch Set 13 #

Patch Set 14 #

Unified diffs Side-by-side diffs Delta from patch set Stats Patch
Doc/library/http.client.rst View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +15 lines, -16 lines 0 comments Download
Doc/library/urllib.request.rst View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +7 lines, -8 lines 0 comments Download
Doc/whatsnew/3.6.rst View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +9 lines, -2 lines 0 comments Download
Lib/http/client.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +8 lines, -23 lines 0 comments Download
Lib/test/test_httplib.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 5 chunks +19 lines, -8 lines 0 comments Download
Lib/test/test_urllib2.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +35 lines, -21 lines 0 comments Download
Misc/NEWS View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +3 lines, -4 lines 0 comments Download

Messages

Total messages: 23
Martin Panter
https://bugs.python.org/review/12319/diff/14223/Doc/library/http.client.rst File Doc/library/http.client.rst (right): https://bugs.python.org/review/12319/diff/14223/Doc/library/http.client.rst#newcode214 Doc/library/http.client.rst:214: the special handling of generators detailed below), readables or ...
2 years, 7 months ago #1
demian
http://bugs.python.org/review/12319/diff/14223/Doc/library/http.client.rst File Doc/library/http.client.rst (right): http://bugs.python.org/review/12319/diff/14223/Doc/library/http.client.rst#newcode214 Doc/library/http.client.rst:214: the special handling of generators detailed below), readables or ...
2 years, 7 months ago #2
Martin Panter
http://bugs.python.org/review/12319/diff/14223/Lib/http/client.py File Lib/http/client.py (right): http://bugs.python.org/review/12319/diff/14223/Lib/http/client.py#newcode923 Lib/http/client.py:923: if encode_chunked and self._http_vsn == 11: On 2015/03/24 17:22:46, ...
2 years, 7 months ago #3
AntoinePitrou
http://bugs.python.org/review/12319/diff/14331/Doc/library/http.client.rst File Doc/library/http.client.rst (right): http://bugs.python.org/review/12319/diff/14331/Doc/library/http.client.rst#newcode226 Doc/library/http.client.rst:226: dynamically (i.e. *body* is an instance of :class:`types.GeneratorType`), Why ...
2 years, 7 months ago #4
demian
http://bugs.python.org/review/12319/diff/14331/Doc/library/http.client.rst File Doc/library/http.client.rst (right): http://bugs.python.org/review/12319/diff/14331/Doc/library/http.client.rst#newcode216 Doc/library/http.client.rst:216: implementing the :ref:`buffer interface <bufferobjects>` such as On 2015/03/27 ...
2 years, 6 months ago #5
Martin Panter
https://bugs.python.org/review/12319/diff/14331/Lib/http/client.py File Lib/http/client.py (right): https://bugs.python.org/review/12319/diff/14331/Lib/http/client.py#newcode1155 Lib/http/client.py:1155: if content_length is not None: On 2015/04/01 01:27:04, demian ...
2 years, 6 months ago #6
Martin Panter
http://bugs.python.org/review/12319/diff/14401/Lib/http/client.py File Lib/http/client.py (right): http://bugs.python.org/review/12319/diff/14401/Lib/http/client.py#newcode902 Lib/http/client.py:902: while 1: On 2015/04/01 06:35:22, vadmium wrote: > while ...
2 years, 6 months ago #7
demian
http://bugs.python.org/review/12319/diff/14331/Lib/http/client.py File Lib/http/client.py (right): http://bugs.python.org/review/12319/diff/14331/Lib/http/client.py#newcode1155 Lib/http/client.py:1155: if content_length is not None: On 2015/04/01 06:35:22, vadmium ...
2 years, 6 months ago #8
Martin Panter
Couple comments on the new bits. I am assuming that the various body data types ...
2 years, 6 months ago #9
demian
http://bugs.python.org/review/12319/diff/14422/Doc/library/http.client.rst File Doc/library/http.client.rst (right): http://bugs.python.org/review/12319/diff/14422/Doc/library/http.client.rst#newcode179 Doc/library/http.client.rst:179: A subclass of :exc:`HTTPException`. Raised if HTTP-specific encoding errors ...
2 years, 5 months ago #10
Martin Panter
https://bugs.python.org/review/12319/diff/14900/Doc/library/http.client.rst File Doc/library/http.client.rst (right): https://bugs.python.org/review/12319/diff/14900/Doc/library/http.client.rst#newcode240 Doc/library/http.client.rst:240: (the object should support ``fileno()`` and ``read()`` methods) or ...
2 years, 5 months ago #11
Martin Panter
https://bugs.python.org/review/12319/diff/17643/Doc/library/http.client.rst File Doc/library/http.client.rst (left): https://bugs.python.org/review/12319/diff/17643/Doc/library/http.client.rst#oldcode227 Doc/library/http.client.rst:227: If *body* is specified, the specified data is sent ...
1 year, 4 months ago #12
Rotkraut
Here come my replies to Martin's review comments. http://bugs.python.org/review/12319/diff/17643/Doc/library/http.client.rst File Doc/library/http.client.rst (left): http://bugs.python.org/review/12319/diff/17643/Doc/library/http.client.rst#oldcode227 Doc/library/http.client.rst:227: If ...
1 year, 3 months ago #13
SilentGhost
Patch needs refreshing against the current tip. https://bugs.python.org/review/12319/diff/17768/Doc/library/http.client.rst File Doc/library/http.client.rst (right): https://bugs.python.org/review/12319/diff/17768/Doc/library/http.client.rst#newcode195 Doc/library/http.client.rst:195: A subclass ...
1 year, 2 months ago #14
Rotkraut
Thanks for the review! Here come my replies. I posted a new version of the ...
1 year, 2 months ago #15
Martin Panter
Reviewed most of the patch except for the test files https://bugs.python.org/review/12319/diff/17643/Doc/library/http.client.rst File Doc/library/http.client.rst (right): https://bugs.python.org/review/12319/diff/17643/Doc/library/http.client.rst#newcode244 ...
1 year, 2 months ago #16
Rotkraut
Thanks for the review! Here come my replies to the comments. https://bugs.python.org/review/12319/diff/18038/Doc/library/http.client.rst File Doc/library/http.client.rst (right): ...
1 year, 2 months ago #17
Martin Panter
https://bugs.python.org/review/12319/diff/18038/Doc/library/urllib.request.rst File Doc/library/urllib.request.rst (right): https://bugs.python.org/review/12319/diff/18038/Doc/library/urllib.request.rst#newcode199 Doc/library/urllib.request.rst:199: standard :mimetype:`application/x-www-form-urlencoded` format. The On 2016/08/09 14:38:57, Rotkraut wrote: ...
1 year, 2 months ago #18
Martin Panter
https://bugs.python.org/review/12319/diff/18100/Lib/http/client.py File Lib/http/client.py (right): https://bugs.python.org/review/12319/diff/18100/Lib/http/client.py#newcode1063 Lib/http/client.py:1063: read = lambda data: (_encode(data),) Currently, endheaders() does not ...
1 year, 2 months ago #19
Rotkraut
Thanks for the review! Here come my replies to the comments. https://bugs.python.org/review/12319/diff/18100/Doc/library/http.client.rst File Doc/library/http.client.rst (right): ...
1 year, 2 months ago #20
Martin Panter
https://bugs.python.org/review/12319/diff/18113/Lib/test/test_httplib.py File Lib/test/test_httplib.py (right): https://bugs.python.org/review/12319/diff/18113/Lib/test/test_httplib.py#newcode693 Lib/test/test_httplib.py:693: self.buffer = next(self.d, None) I’m not sure about this ...
1 year, 2 months ago #21
Rotkraut
Reply to the comment. https://bugs.python.org/review/12319/diff/18113/Lib/test/test_httplib.py File Lib/test/test_httplib.py (right): https://bugs.python.org/review/12319/diff/18113/Lib/test/test_httplib.py#newcode693 Lib/test/test_httplib.py:693: self.buffer = next(self.d, None) On ...
1 year, 2 months ago #22
Martin Panter
1 year, 2 months ago #23
https://bugs.python.org/review/12319/diff/18113/Lib/test/test_httplib.py
File Lib/test/test_httplib.py (right):

https://bugs.python.org/review/12319/diff/18113/Lib/test/test_httplib.py#newc...
Lib/test/test_httplib.py:693: self.buffer = next(self.d, None)
On 2016/08/11 14:51:01, Rotkraut wrote:
> On 2016/08/11 14:18:07, vadmium wrote:
> > I’m not sure about this change. The previous code would have raised
> > StopIteration at EOF, now you return None. Maybe it is safer to drop most of
> > this change now that we just rely on TextIOBase.
> 
> That is intended. The behavior is much closer to that of an actual file this
> way.  file-like objects are not supposed to raise StopIteration.

If StopIteration were to be raised, it would indicate that the test has failed,
which is a good thing. File objects are allowed to raise their own exceptions.

My other objection is the change makes a simple class much more complicated. IMO
if anything in this test should be changed it is None should become an empty
string "", the proper EOF indicator. But this is all independent of chunked
encoding.

I will drop most of these changes (except inheriting TextIOBase).
Sign in to reply to this message.

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7