[New-bugs-announce] [issue27247] telnetlib AttributeError: 'error' object has no attribute 'errno' (handling of select.error)

Muhammad Toufeeq Ockards report at bugs.python.org
Tue Jun 7 04:24:36 EDT 2016


New submission from Muhammad Toufeeq Ockards:

I was using the telnetlib on linux in python 2.7 and ran into error that executed line 320 of https://hg.python.org/cpython/file/2.7/Lib/telnetlib.py 

----------------------------------
319: except select.error as e:
320:    if e.errno == errno.EINTR:
------------------------------------

Inspecting select.error showed that it has no errno attribute.

I opened up a python2.7 idle session on my computer and entered the following. 


---------------------------------------------------------
>>> import select
>>> try:
...     raise select.error
... except Exception as e:
...     pass
... 
>>> e
error()
>>> dir(e)
['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__getitem__', '__getslice__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setstate__', '__sizeof__', '__str__', '__subclasshook__', '__unicode__', '__weakref__', 'args', 'message']
>>> e.errno
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'error' object has no attribute 'errno'
>>> 
-------------------------------------------------------------

----------
components: Library (Lib)
messages: 267603
nosy: Muhammad Toufeeq Ockards
priority: normal
severity: normal
status: open
title: telnetlib AttributeError: 'error' object has no attribute 'errno' (handling of select.error)
type: behavior
versions: Python 2.7

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


More information about the New-bugs-announce mailing list