[ python-Bugs-1080713 ] os.ttyname() accepts wrong arguments

SourceForge.net noreply at sourceforge.net
Tue Dec 7 17:32:48 CET 2004


Bugs item #1080713, was opened at 2004-12-07 08:32
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1080713&group_id=5470

Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Christian Höltje (docwhat)
Assigned to: Nobody/Anonymous (nobody)
Summary: os.ttyname() accepts wrong arguments

Initial Comment:
Problem:
  The doc for os.ttyname says it accepts an fd
What Happens:
  It raises a type error and says it expects an integer
instead.
  Experimentally, it seems to accept fd.fileno() as input
What should happen:
  It should an accept an fd (file object)

I have attached a test case for this.

The output I get using python 2.2 & 2.3 is:
Documentation Sez:
------------------------------------------------------------
ttyname(fd) -> String
Return the name of the terminal device connected to 'fd'.
------------------------------------------------------------

TTY Name (should work):    exceptions.TypeError an
integer is required
TTY Name (shouldn't work): /dev/pts/2

Ciao!


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1080713&group_id=5470


More information about the Python-bugs-list mailing list