[New-bugs-announce] [issue43717] Confusing OSError on HTTP CONNECT failure
report at bugs.python.org
Sat Apr 3 15:38:31 EDT 2021
New submission from Michael Osipov <1983-01-06 at gmx.net>:
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.
components: Library (Lib)
title: Confusing OSError on HTTP CONNECT failure
versions: Python 3.9
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce