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: Confusing OSError on HTTP CONNECT failure
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.9
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: michael-o
Priority: normal Keywords:

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

Messages (1)
msg390138 - (view) Author: Michael Osipov (michael-o) * Date: 2021-04-03 19:38
When working with proxies and HTTP CONNECT I came across these lines: https://github.com/python/cpython/blob/63c69440c7adb0de1d191a8d3d100b335d5c2f81/Lib/http/client.py#L901-L903

I truly fail to see why this is an OSError. OSErrors (https://docs.python.org/3/library/exceptions.html#os-exceptions) describe a low-level issues, but HTTP is a high level protocol. I would expect something like NotConnected or at least something which derives from HTTPException.

OSError is expected on socket issues only.
History
Date User Action Args
2022-04-11 14:59:43adminsetgithub: 87883
2021-04-03 19:38:31michael-ocreate