[New-bugs-announce] [issue18587] urllib raises exception with string in 'errno' attribute

Denis report at bugs.python.org
Mon Jul 29 18:01:57 CEST 2013


New submission from Denis:

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: ...'

----------
files: pyerror.py
messages: 193878
nosy: denkoren
priority: normal
severity: normal
status: open
title: urllib raises exception with string in 'errno' attribute
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file31075/pyerror.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18587>
_______________________________________


More information about the New-bugs-announce mailing list