[Patches] [ python-Patches-671384 ] test_pty hanging on hpux11

SourceForge.net noreply@sourceforge.net
Mon, 03 Mar 2003 02:59:25 -0800


Patches item #671384, was opened at 2003-01-20 22:23
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=671384&group_id=5470

Category: Modules
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Neal Norwitz (nnorwitz)
Assigned to: Martin v. Löwis (loewis)
Summary: test_pty hanging on hpux11

Initial Comment:
The attached hack fixes a problem which occurs since
switching the pty code.  isatty() hangs if the slave_fd
is closed and reopened as in the deprecated APIs
pty.master_open() and pty.slave_open().

This patch reverts to the old behaviour where
_open_terminal() is called in master_open() to avoid
the hang later.

Here's a very simple test for the problem:

import pty, os

master_fd, slave_name = pty.master_open()
slave_fd = pty.slave_open(slave_name)
print os.isatty(slave_fd)

In slave_open() the first ioctl raises an IOError,
Invalid Argument 22.

I don't know if this problem affects hpux10.  Hopefully
someone will have a better idea how to really fix this
problem.

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

>Comment By: Martin v. Löwis (loewis)
Date: 2003-03-03 11:59

Message:
Logged In: YES 
user_id=21627

I can't reproduce a test failure for Solaris 8 (on the SF
compile farm) for Python 2.3a2. Can you please try that
specific release and report what test fails for you, in
which way?

I'm concerned that the patch isn't that good, e.g. on Linux,
it would cause usage of the old-style interface to
pseudo-terminals, even though an all-singing all-dancing
Unix98 pty support is available in the C library.

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

Comment By: Neal Norwitz (nnorwitz)
Date: 2003-01-28 01:21

Message:
Logged In: YES 
user_id=33168

I have attached an updated patch.  It seems Solaris 8 (on
the snake farm) also had a test failure.  I have basically
restored the old functionality in this patch. 
_open_terminal is called if /dev/ptmx exists, so
os.openpty() is not called.  This fixes the test
failures/hangs on both solaris and hpux and should be
equivalent to the 2.2 behaviour.

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

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