New submission from Matej Cepl: 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(). ---------- components: Library (Lib) files: urllib2-kerberos-log.txt messages: 205446 nosy: mcepl priority: normal severity: normal status: open title: [httplib] logging information for request is not pretty printed Added file: http://bugs.python.org/file33021/urllib2-kerberos-log.txt _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue19917> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com