[issue13736] urllib.request.urlopen leaks exceptions from socket and httplib.client

2015-11-16 Thread Martin Panter
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

[issue13736] urllib.request.urlopen leaks exceptions from socket and httplib.client

2013-12-07 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13736 ___ ___ Python-bugs-list

[issue13736] urllib.request.urlopen leaks exceptions from socket and httplib.client

2012-02-08 Thread Senthil Kumaran
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.

[issue13736] urllib.request.urlopen leaks exceptions from socket and httplib.client

2012-01-20 Thread Senthil Kumaran
Changes by Senthil Kumaran sent...@uthcode.com: -- assignee: - orsenthil ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13736 ___ ___

[issue13736] urllib.request.urlopen leaks exceptions from socket and httplib.client

2012-01-20 Thread Antoine Pitrou
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

[issue13736] urllib.request.urlopen leaks exceptions from socket and httplib.client

2012-01-20 Thread Jyotirmoy Bhattacharya
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

[issue13736] urllib.request.urlopen leaks exceptions from socket and httplib.client

2012-01-20 Thread Antoine Pitrou
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

[issue13736] urllib.request.urlopen leaks exceptions from socket and httplib.client

2012-01-13 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- nosy: +eric.araujo, ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13736 ___ ___

[issue13736] urllib.request.urlopen leaks exceptions from socket and httplib.client

2012-01-07 Thread Jyotirmoy Bhattacharya
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

[issue13736] urllib.request.urlopen leaks exceptions from socket and httplib.client

2012-01-07 Thread Jyotirmoy Bhattacharya
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