New submission from Matt Houglum <houg...@google.com>:

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.

----------
components: Library (Lib)
messages: 339424
nosy: Matt Houglum
priority: normal
severity: normal
status: open
title: http/client.py does not print duplicate header values in debug
versions: Python 3.6, Python 3.7, Python 3.8

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

Reply via email to