[New-bugs-announce] [issue17233] http.client header debug output format

Kim Gräsman report at bugs.python.org
Tue Feb 19 07:52:54 CET 2013


New submission from Kim Gräsman:

Python 3.2.3 on 64-bit Windows 7.

When I set debuglevel on HTTPConnection to 1, the output seems jumbled, and I'm having trouble interpreting it.

Attached is a full, anonymized log from a conversation I was troubleshooting.

Here's an excerpt:

 send: b'GET /a HTTP/1.1\r\nHost: localhost:55380\r\nAccept-Encoding: identity\r\n\r\n'
 reply: 'HTTP/1.1 503 Service unavailable\r\n'
 header: Connection header: Content-Length header: Content-Type header: Date send: b'GET /a HTTP/1.1\r\nHost: localhost:55380\r\nAccept-Encoding: identity\r\n\r\n'
 reply: 'HTTP/1.1 503 Service unavailable\r\n'

- Does line 3, starting with header:, show headers for the request or response? I'm guessing response, but it didn't occur to me until just now, after a full day of looking at it.
- It would be nice if the header dump showed both header key and value
- There's a trailing "send:" at the end of the header: line, shouldn't that be on its own line?

Overall, not printing a newline after these debug statements makes it really hard to combine with other print debugging, as unrelated prints show up at the end of every line of httpclient's debug output.

I find "header" a bit confusing as a prefix, as it doesn't say whether it's request or response headers. Maybe change the prefix to "response-headers:" and also add "request-headers:", even if those are visible in the "send:" lines? Alternatively, why not show the response headers in the "reply:" dump?

Would you consider patches to address these concerns?

Thank you!

----------
components: Library (Lib)
files: httpclient.debuglevel.txt
messages: 182367
nosy: Kim.Gräsman
priority: normal
severity: normal
status: open
title: http.client header debug output format
type: behavior
versions: Python 3.2
Added file: http://bugs.python.org/file29120/httpclient.debuglevel.txt

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17233>
_______________________________________


More information about the New-bugs-announce mailing list