[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 be

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

2013-12-07 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

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

2012-02-08 Thread Senthil Kumaran
Senthil Kumaran 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. But that could be ch

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

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

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

2012-01-20 Thread Jyotirmoy Bhattacharya
Jyotirmoy Bhattacharya 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 clients who only catch

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

2012-01-20 Thread Antoine Pitrou
Antoine Pitrou 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 Senthil Kumaran
Changes by Senthil Kumaran : -- assignee: -> orsenthil ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://

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

2012-01-13 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +eric.araujo, ezio.melotti ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: ht

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

2012-01-07 Thread Jyotirmoy Bhattacharya
Jyotirmoy Bhattacharya 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 type: -> behavior Added fi

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

2012-01-07 Thread Jyotirmoy Bhattacharya
New submission from Jyotirmoy Bhattacharya : 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 urllib, thus breaking the pr