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: pty.spawn - wrong error caught
Type: Stage:
Components: Library (Lib) Versions: Python 2.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: loewis, rasjidw
Priority: normal Keywords:

Created on 2002-07-15 14:18 by rasjidw, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Messages (2)
msg11597 - (view) Author: Rasjid Wilcox (rasjidw) Date: 2002-07-15 14:18
With Python 2.2 as installed on Redhat Linux 7.3, I get
the following error with pty.spawn.

-----------  test-pty.py  ------------

#!/usr/bin/python2

import os, sys, pty

sp = raw_input("Spawn a new process?")
if sp == 'y':
    pty.spawn(('/bin/ls', '/etc'))

a = raw_input()
print a

------------ end code ---------------

Traceback (most recent call last):
  File "test-pty.py", line 7, in ?
    pty.spawn(('/bin/ls', '/etc'))
  File "/usr/lib/python2.2/pty.py", line 160, in spawn
    _copy(master_fd, master_read, stdin_read)
  File "/usr/lib/python2.2/pty.py", line 144, in _copy
    data = master_read(master_fd)
  File "/usr/lib/python2.2/pty.py", line 133, in _read
    return os.read(fd, 1024)
OSError: [Errno 5] Input/output error

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

I have checked the CVS version, and it looks like it
will still give the same error.

I am about to submit a 1 line patch, which as far as I
can tell fixes the problem (at least for me).  See the
patches tracker.

Rasjid.
msg11598 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2002-07-30 14:26
Logged In: YES 
user_id=21627

This has been fixed in CVS now with patch #581705.
History
Date User Action Args
2022-04-10 16:05:30adminsetgithub: 36897
2002-07-15 14:18:55rasjidwcreate