2026-08-23 21:23 UTC
@whitequark@social.treehouse.systems
Progress!
But the problem of like requests.HTTPError often showing up wrong as its less brief alias requests.exceptions.HTTPError will remain?
assert requests.exceptions.HTTPError is requests.HTTPError
import requests
r = requests.get("https://example.com/dev/null/child")
try:
r.raise_for_status()
except Exception as exc:
texts = traceback.format_exception(exc, limit=0)
print(texts[0].rstrip())
What prints is
> requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://example.com/dev/null/child
Sigh.
We're supposed to teach everyone to misread that concrete result as if it were
> requests.HTTPError: 404 ...
Sigh.
Replies (1)
-
@whitequark@social.treehouse.systems 2026-08-23 21:27
@pelavarre@social.vivaldi.net that seems... normal? an alias doesn't override a canonical name. (you could do this by overriding .__module__ I think)