You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
urllib raises exception with string in 'errno' attribute #62787
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2013-07-29.17:16:38.664>created_at=<Date2013-07-29.16:01:57.871>labels= ['type-bug']
title="urllib raises exception with string in 'errno' attribute"updated_at=<Date2013-07-29.17:16:38.661>user='https://bugs.python.org/denkoren'
Activity
denkoren commentedon Jul 29, 2013
On 'connection refused' error urllib creates IOError with wrong arguents:
args ('socket error', error(<os-dependent-number>, 'Connection refused'))
It results to dirty hacks in Python code like
'if e.errno == "socket error": ...'
instead of traditional
'id e.errno == errno.ECONNREFUSED: ...'
bitdancer commentedon Jul 29, 2013
This is a duplicate of bpo-6471, which we really do need to fix. But there are backward compatibility concerns with fixing it in 2.7, I'm afraid.