Author Kim.Gräsman
Recipients Kim.Gräsman
Date 2013-02-19.06:52:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1361256774.67.0.162902666936.issue17233@psf.upfronthosting.co.za>
In-reply-to
Content
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!
History
Date User Action Args
2013-02-19 06:52:54Kim.Gräsmansetrecipients: + Kim.Gräsman
2013-02-19 06:52:54Kim.Gräsmansetmessageid: <1361256774.67.0.162902666936.issue17233@psf.upfronthosting.co.za>
2013-02-19 06:52:54Kim.Gräsmanlinkissue17233 messages
2013-02-19 06:52:54Kim.Gräsmancreate