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

#23350: Content-length is incorrect when request body is a list or tuple

Can't Edit
Can't Publish+Mail
Start Review
Created:
4 years, 3 months ago by demianbrecht
Modified:
4 years, 3 months ago
Reviewers:
pitrou, vadmium+py
CC:
orsenthil, r.david.murray, berkerpeksag, Martin Panter, storchaka, demian, vincent.alquier_gmail.com
Visibility:
Public.

Patch Set 1 #

Total comments: 4

Patch Set 2 #

Patch Set 3 #

Total comments: 2

Patch Set 4 #

Unified diffs Side-by-side diffs Delta from patch set Stats Patch
Doc/library/http.client.rst View 1 2 3 2 chunks +8 lines, -2 lines 0 comments Download
Lib/http/client.py View 1 2 3 3 chunks +25 lines, -16 lines 0 comments Download
Lib/test/test_httplib.py View 1 2 3 2 chunks +19 lines, -1 line 0 comments Download

Messages

Total messages: 3
AntoinePitrou
http://bugs.python.org/review/23350/diff/13773/Lib/http/client.py File Lib/http/client.py (right): http://bugs.python.org/review/23350/diff/13773/Lib/http/client.py#newcode1031 Lib/http/client.py:1031: if isinstance(body, list) or isinstance(body, tuple): You can write ...
4 years, 3 months ago #1
demian
Thanks for the review Antoine. I'm not overly keen on how the body is currently ...
4 years, 3 months ago #2
Martin Panter
4 years, 3 months ago #3
http://bugs.python.org/review/23350/diff/13925/Lib/test/test_httplib.py
File Lib/test/test_httplib.py (right):

http://bugs.python.org/review/23350/diff/13925/Lib/test/test_httplib.py#newco...
Lib/test/test_httplib.py:1236: for body, expected, expected_len in cases:
Call subTest(body) inside the loop, that way if a subtest fails, the next
iteration can be tried, and we identify which subtest failed.

http://bugs.python.org/review/23350/diff/13925/Lib/test/test_httplib.py#newco...
Lib/test/test_httplib.py:1242: self.assertEqual('text/plain',
msg.get_content_type())
Maybe assertNotIn("Content-Type", msg) might be more accurate
Sign in to reply to this message.

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