[issue46517] Review exception handling in urllib.parse
Irit Katriel
report at bugs.python.org
Tue Jan 25 07:37:21 EST 2022
Irit Katriel <iritkatriel at gmail.com> added the comment:
In urllib.request, there are in a few places things like:
except OSError as msg:
raise OSError('socket error', msg).with_traceback(sys.exc_info()[2])
I imagine this predates chaining - is there a reason not to raise..from here instead of wrapping the "msg" exception (I'm guessing from the name that this used to be a string, but now it's actually an exception).
----------
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46517>
_______________________________________
More information about the Python-bugs-list
mailing list