This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pareshverma91
Recipients pareshverma91
Date 2017-04-05.08:04:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1491379482.82.0.913101246746.issue29991@psf.upfronthosting.co.za>
In-reply-to
Content
When http client parses a multipart response, it always taints the headers with defects. e.g.
Use the attached file to start a simple http server, using current python exec, with commands:
```python .\example_bug.py server```
and run client with:
```python .\example_bug.py client```
which outputs:
"""[StartBoundaryNotFoundDefect(), MultipartInvariantViolationDefect()]"""

even though the multipart response is correct.
This appears to be happening because http.client, when parsing headers of response doesn't specifies the headersonly option, which leads to email.feedparser to parse response body (but http.client only passes header lines for parsing in parse_headers method, and the request body isn't available to email.feedparser).

The issue has been mentioned at:
https://github.com/shazow/urllib3/issues/800
https://github.com/Azure/azure-storage-python/issues/167

The submitted PR partially fixes the problem:
```..\python.bat .\example_bug.py client```
which outputs
"""[MultipartInvariantViolationDefect()]"""
History
Date User Action Args
2017-04-05 08:04:42pareshverma91setrecipients: + pareshverma91
2017-04-05 08:04:42pareshverma91setmessageid: <1491379482.82.0.913101246746.issue29991@psf.upfronthosting.co.za>
2017-04-05 08:04:42pareshverma91linkissue29991 messages
2017-04-05 08:04:42pareshverma91create