Martin Panter added the comment:
There is another patch in duplicate Issue 8823, which has simpler exception
wrapping code, but does not add wrapping of reply exceptions.
Personally, I wouldn’t endorse any new wrapping HTTP client exceptions, and
even if wrapping more socket OS errors would
Changes by Martin Panter vadmium...@gmail.com:
--
nosy: +vadmium
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13736
___
___
Python-bugs-list
Senthil Kumaran sent...@uthcode.com added the comment:
I have stumbled upon a wrong impression as well by reading the docs, but
usually in the code, I tend to catch the specific Exceptions, like timeout
instead or URLError when it is known. I saw some libraries following similar
pattern too.
Changes by Senthil Kumaran sent...@uthcode.com:
--
assignee: - orsenthil
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13736
___
___
Antoine Pitrou pit...@free.fr added the comment:
I think the general pattern of wrapping exceptions in other exceptions is
rather unfortunate. It makes it harder to examine the original problem (for
example the ``errno`` attribute) for no actual gain.
--
nosy: +pitrou
Jyotirmoy Bhattacharya jyotir...@jyotirmoy.net added the comment:
Antoine, could raise ... from be used here? Perhaps also using new subclasses
of URLError to allow the exceptions to be caught with finer granularity. That
way no information would be lost while at the same time not surprising
Antoine Pitrou pit...@free.fr added the comment:
Antoine, could raise ... from be used here?
That's a possible compromise indeed. It's up to Senthil to decide
anyway.
Perhaps also using new subclasses of URLError to allow the exceptions
to be caught with finer granularity. That way no
Changes by Éric Araujo mer...@netwok.org:
--
nosy: +eric.araujo, ezio.melotti
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13736
___
___
New submission from Jyotirmoy Bhattacharya jyotir...@jyotirmoy.net:
The documentation for urlopen says that it raises URLError on error.
But there exist error conditions such as a socket timeout or a bad HTTP status
line under which the exception from the underlying library leaks through
Jyotirmoy Bhattacharya jyotir...@jyotirmoy.net added the comment:
A patch to fix this issue. Catches exceptions from underlying libraries and
reraises them as URLError.
I put the class name of the underlying exception in the reason to make it more
descriptive.
--
keywords: +patch
10 matches
Mail list logo