New submission from Paresh Verma:

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()]"""

----------
components: Library (Lib)
files: example_bug.py
messages: 291165
nosy: pareshverma91
priority: normal
pull_requests: 1172
severity: normal
status: open
title: http client marks valid multipart headers with defects.
type: behavior
versions: Python 3.5
Added file: http://bugs.python.org/file46780/example_bug.py

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

Reply via email to