This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: test_pty hanging on hpux11
Type: Stage:
Components: Extension Modules Versions: Python 2.3
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: nnorwitz Nosy List: loewis, nnorwitz
Priority: normal Keywords: patch

Created on 2003-01-20 21:23 by nnorwitz, last changed 2022-04-10 16:06 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
pty.diff nnorwitz, 2003-01-20 21:24 pty patch 1 to revert to old behaviour on hpux11
pty2.diff nnorwitz, 2003-01-28 00:21 updated, less hacky patch
Messages (6)
msg42496 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2003-01-20 21:23
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.
msg42497 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2003-01-28 00:21
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.
msg42498 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2003-03-03 10:59
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.
msg42499 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2003-03-03 22:23
Logged In: YES 
user_id=33168

I don't understand what you are asking for.  By 'specific
release', do you mean of Solaris/HP-UX?  I believe on
Solaris there's an exception, but on HP-UX it hangs.  But I
don't recall exactly.  I agree this patch is not optimal.  I
can also try on our Solaris box here.
msg42500 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2003-03-03 23:13
Logged In: YES 
user_id=21627

By 'specific release', I mean Python 2.3a2, with no patches.
I can't reproduce an exception on that Python release, for
Solaris 8.
msg42501 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2003-03-04 14:19
Logged In: YES 
user_id=33168

I don't seem to have this problem any more on either HP-UX
or Solaris.
History
Date User Action Args
2022-04-10 16:06:09adminsetgithub: 37805
2003-01-20 21:23:20nnorwitzcreate