Turning on debug output for python 3 urllib
You were right the first time. You can simply add the line http.client.HTTPConnection.debuglevel = 1
at the start of your file to turn on HTTP debugging application-wide. urllib.request
still uses http.client
.
It seems that there's also a way to set the debuglevel for a single handler (by creating urllib.request.HTTPHandler(debuglevel=1)
and building an opener with that), but on my installation of Python3 (3.0b3) it's not actually implemented. I imagine that's changed in more recent versions!