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.

classification
Title: HTTP CONNECT response not subject to debug level
Type: Stage: patch review
Components: Library (Lib) Versions: Python 3.10, Python 3.9, Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: andrei.avk, michael-o
Priority: normal Keywords: patch

Created on 2021-04-03 19:45 by michael-o, last changed 2022-04-11 14:59 by admin.

Pull Requests
URL Status Linked Edit
PR 26932 open andrei.avk, 2021-06-28 12:11
Messages (5)
msg390139 - (view) Author: Michael Osipov (michael-o) * Date: 2021-04-03 19:45
Looking at https://github.com/python/cpython/blob/63c69440c7adb0de1d191a8d3d100b335d5c2f81/Lib/http/client.py#L898
self.debuglevel is not passed to response_class() and for debugging purposes I miss to see:
> send: b'CONNECT some-host:443 HTTP/1.0\r\n'
> send: b'\r\n'
> reply: 'HTTP/1.0 502 Bad Gateway\r\n'

reply is missing. It trivial to pass the debug level.
msg396592 - (view) Author: Andrei Kulakov (andrei.avk) * (Python triager) Date: 2021-06-27 17:59
Michael: Thanks for the report! would you like to create a PR? If not, I can do that.
msg396595 - (view) Author: Andrei Kulakov (andrei.avk) * (Python triager) Date: 2021-06-27 19:08
Also note that the debug arg should be provided only if it's greater than 0, for cases when you might want to have connection at debug 0, and a custom response class with a default nonzero debug level.
msg396612 - (view) Author: Michael Osipov (michael-o) * Date: 2021-06-28 07:21
Thanks Andrei, please ahead and provide the PR. You'll do it faster than I do.
msg396630 - (view) Author: Andrei Kulakov (andrei.avk) * (Python triager) Date: 2021-06-28 12:12
The PR is here:
https://github.com/python/cpython/pull/26932
History
Date User Action Args
2022-04-11 14:59:43adminsetgithub: 87884
2021-06-28 12:12:44andrei.avksetmessages: + msg396630
2021-06-28 12:11:35andrei.avksetkeywords: + patch
stage: patch review
pull_requests: + pull_request25501
2021-06-28 07:21:44michael-osetmessages: + msg396612
2021-06-27 19:08:27andrei.avksetmessages: + msg396595
2021-06-27 17:59:02andrei.avksetnosy: + andrei.avk
messages: + msg396592
2021-04-03 19:45:12michael-ocreate