classification
Title: http/client.py does not print duplicate header values in debug
Type: Stage: resolved
Components: Library (Lib) Versions: Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: houglum, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2019-04-04 02:45 by houglum, last changed 2019-04-04 08:27 by serhiy.storchaka. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 12681 merged python-dev, 2019-04-04 03:41
PR 12682 merged miss-islington, 2019-04-04 04:37
Messages (4)
msg339424 - (view) Author: Matt Houglum (houglum) * Date: 2019-04-04 02:45
This is a follow-up to https://bugs.python.org/issue33365.  The fix for that issue (see https://github.com/python/cpython/pull/6611) added a statement to also print header values, but it does not account for the case where multiple values exist for the same header name, e.g. if my response contained these headers:

x-goog-hash: crc32c=KAwGng==
x-goog-hash: md5=eB5eJF1ptWaXm4bijSPyxw==

then the debug output would print whichever of those values is returned from `self.headers.get("x-goog-hash")` for both prints:

header: x-goog-hash: crc32c=KAwGng==
header: x-goog-hash: crc32c=KAwGng==

The iteration should instead be done using self.headers.items(), which will return the key and value pair to be printed. I'll send a GitHub PR shortly.
msg339432 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2019-04-04 04:36
New changeset 461c416dd78a98f2bba7f323af8c9738e060b6f2 by Serhiy Storchaka (Matt Houglum) in branch 'master':
bpo-36522: Print all values for headers with multiple values. (GH-12681)
https://github.com/python/cpython/commit/461c416dd78a98f2bba7f323af8c9738e060b6f2
msg339435 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2019-04-04 08:26
New changeset 6f9cd142a20d0d2a5825a9db376ce0ddf1933694 by Serhiy Storchaka (Miss Islington (bot)) in branch '3.7':
bpo-36522: Print all values for headers with multiple values. (GH-12681) (GH-12682)
https://github.com/python/cpython/commit/6f9cd142a20d0d2a5825a9db376ce0ddf1933694
msg339436 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2019-04-04 08:27
3.6 take only security bugs fixes now.
History
Date User Action Args
2019-04-04 08:27:34serhiy.storchakasetstatus: open -> closed
versions: - Python 3.6
messages: + msg339436

resolution: fixed
stage: patch review -> resolved
2019-04-04 08:26:04serhiy.storchakasetmessages: + msg339435
2019-04-04 04:37:25miss-islingtonsetpull_requests: + pull_request12610
2019-04-04 04:36:52serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg339432
2019-04-04 03:41:27python-devsetkeywords: + patch
stage: patch review
pull_requests: + pull_request12608
2019-04-04 02:45:33houglumcreate