[issue18587] urllib raises exception with string in 'errno' attribute

2013-07-29 Thread R. David Murray
R. David Murray added the comment: This is a duplicate of issue 6471, which we really do need to fix. But there are backward compatibility concerns with fixing it in 2.7, I'm afraid. -- nosy: +r.david.murray resolution: -> duplicate stage: -> committed/rejected status: open -> closed

[issue18587] urllib raises exception with string in 'errno' attribute

2013-07-29 Thread Denis
New submission from Denis: On 'connection refused' error urllib creates IOError with wrong arguents: args ('socket error', error(, 'Connection refused')) It results to dirty hacks in Python code like 'if e.errno == "socket error": ...' instead of traditional 'id e.errno == errno.ECONNREFUS