This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mcepl
Recipients mcepl
Date 2013-12-07.10:44:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1386413080.92.0.351429113589.issue19917@psf.upfronthosting.co.za>
In-reply-to
Content
looking at
http://hg.python.org/cpython/file/543c76769c14/Lib/http/client.py#l847
(logging in HTTPConnection.send method; but this code has been same since like forever) I see that the HTTP request is NOT pretty printed:

     if self.debuglevel > 0:
         print("send:", repr(data))

whereas response in effect (because every header is printed separately) is. Wouldn't it be better to pretty print the request as well?

Otherwise I get quite unreadable debugging logs like the following (notice how much response is more readable than request).

It seems to me that proper solution could be just to replace repr() here with something more readable. Wouldn't just str() help? Barring that we can go all the way to pprint.pformat().
History
Date User Action Args
2013-12-07 10:44:40mceplsetrecipients: + mcepl
2013-12-07 10:44:40mceplsetmessageid: <1386413080.92.0.351429113589.issue19917@psf.upfronthosting.co.za>
2013-12-07 10:44:40mcepllinkissue19917 messages
2013-12-07 10:44:40mceplcreate