classification
Title: telnetlib incorrectly assumes that select.error has an errno attribute
Type: behavior Stage: resolved
Components: Versions: Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Thayu.R, gregory.p.smith, pconnell
Priority: normal Keywords: patch

Created on 2013-05-22 17:36 by gregory.p.smith, last changed 2017-12-29 20:46 by gregory.p.smith. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 5044 merged Segev Finer, 2017-12-29 13:19
Messages (4)
msg189828 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2013-05-22 17:36
In Python 2.7.3 through 2.7.5 the telnetlib select.poll based implementation assumes that select.error has an errno attribute when handling errors.  it does not.  select.error is not an EnvironmentError derived exception.

http://hg.python.org/cpython/file/85c04fdaa404/Lib/telnetlib.py#l317

i haven't check 3.x yet.
msg189830 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2013-05-22 17:40
As this is only on the select.poll code path, a workaround for code that isn't going to hit select.select file descriptor limits is to set their telnetlib.Telnet instance _has_poll attribute to False before using it.

my_telnet = telnetlib.Telnet(...)
my_telnet._has_poll = False
msg189849 - (view) Author: Thayu R (Thayu.R) Date: 2013-05-23 05:50
Just to add:
select.error was made an alias of OSError following PEP 3151 from 3.3 onwards. Up to 3.2, it was a pair containing the error code and the error string.

http://docs.python.org/3.3/library/select.html?highlight=select.error#select.error
msg309193 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2017-12-29 20:44
New changeset 3ceaed0dce81fd881bbaf2dbdbe827d9681887da by Gregory P. Smith (Segev Finer) in branch '2.7':
bpo-18035: telnetlib: select.error doesn't have an errno attribute (#5044)
https://github.com/python/cpython/commit/3ceaed0dce81fd881bbaf2dbdbe827d9681887da
History
Date User Action Args
2017-12-29 20:46:05gregory.p.smithsetstatus: open -> closed
type: behavior
resolution: fixed
stage: patch review -> resolved
2017-12-29 20:44:09gregory.p.smithsetmessages: + msg309193
2017-12-29 13:19:30Segev Finersetkeywords: + patch
stage: patch review
pull_requests: + pull_request4925
2016-06-07 12:22:07berker.peksaglinkissue27247 superseder
2013-05-25 09:27:36pconnellsetnosy: + pconnell
2013-05-23 05:50:23Thayu.Rsetnosy: + Thayu.R
messages: + msg189849
2013-05-22 17:40:49gregory.p.smithsetmessages: + msg189830
2013-05-22 17:36:57gregory.p.smithcreate