From 3e4528acc1bb1335fe1eaa96e3503c30dd2cfba2 Mon Sep 17 00:00:00 2001 From: Paresh Verma Date: Tue, 4 Apr 2017 22:03:15 -0700 Subject: [PATCH] Set headersonly for parsing header data. http.client's parse_headers ends up providing only header data to parsestr, but doesn't set the headersonly option. This ends up generating warning for StartBoundaryNotFoundDefect. This only corrects this defect. --- Lib/http/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/http/client.py b/Lib/http/client.py index 0234199dfa9207..9d1e7a0d8e19e5 100644 --- a/Lib/http/client.py +++ b/Lib/http/client.py @@ -211,7 +211,7 @@ def parse_headers(fp, _class=HTTPMessage): if line in (b'\r\n', b'\n', b''): break hstring = b''.join(headers).decode('iso-8859-1') - return email.parser.Parser(_class=_class).parsestr(hstring) + return email.parser.Parser(_class=_class).parsestr(hstring, headersonly=True) class HTTPResponse(io.BufferedIOBase):