[issue6471] errno and strerror attributes incorrectly set on socket errors wrapped by urllib

2021-11-30 Thread Irit Katriel
Irit Katriel added the comment: Reproduced on 3.11: >>> from urllib.request import urlopen >>> try: ... urlopen('http://www.pythonfoobarbaz.org') ... except Exception as exc: ... err = exc ... print('err:', err) ... print('repr(err):', repr(err)) ... print('err.errno:',

[issue6471] errno and strerror attributes incorrectly set on socket errors wrapped by urllib

2013-07-29 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- nosy: +denkoren ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6471 ___ ___ Python-bugs-list

[issue6471] errno and strerror attributes incorrectly set on socket errors wrapped by urllib

2012-09-19 Thread Ezio Melotti
Ezio Melotti added the comment: I seem to remember writing code that fished the wrapped error out using one of those attributrs... That would be err.reason: from urllib.request import urlopen try: urlopen('http://www.pythonfoobarbaz.org') except Exception as exc: print('err:', err)

[issue6471] errno and strerror attributes incorrectly set on socket errors wrapped by urllib

2012-09-19 Thread Chris Jerdonek
Changes by Chris Jerdonek chris.jerdo...@gmail.com: -- nosy: +cjerdonek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6471 ___ ___

[issue6471] errno and strerror attributes incorrectly set on socket errors wrapped by urllib

2012-09-19 Thread R. David Murray
R. David Murray added the comment: Ah, of course. I should have reread the whole issue :) The backward compatibility is the big concern here. Regardless of what we do about that, we should at least fix this in 3.4. -- ___ Python tracker

[issue6471] errno and strerror attributes incorrectly set on socket errors wrapped by urllib

2012-08-03 Thread R. David Murray
R. David Murray added the comment: This is an interesting idea and should at least improve matters. I'm wondering, though...I seem to remember writing code that fished the wrapped error out using one of those attributrs...but I'm not at a computer where I can try to check on that. Hopefully

[issue6471] errno and strerror attributes incorrectly set on socket errors wrapped by urllib

2012-07-28 Thread Catherine Devlin
Catherine Devlin added the comment: It's very hard to tell what ought to be done here, since Lib/urllib/request.py throws URLErrors with a great variety of order and number of arguments, and it's not clear how URLError (in Lib/urllib/error.py) intends to handle them. However, in this case,

[issue6471] errno and strerror attributes incorrectly set on socket errors wrapped by urllib

2010-02-27 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: Can this be fixed without breaking compatibility? It also affects Python2.7 and maybe also Python 3.x (there the error is different and might be intentional). Copy/pastable snippet to reproduce the error on 2.x: from urllib import urlopen

[issue6471] errno and strerror attributes incorrectly set on socket errors wrapped by urllib

2009-07-12 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- title: errno and strerror attributes incorrectly set on socket.error - errno and strerror attributes incorrectly set on socket errors wrapped by urllib ___ Python tracker rep...@bugs.python.org