Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pty.spawn - wrong error caught #36897

Closed
rasjidw mannequin opened this issue Jul 15, 2002 · 2 comments
Closed

pty.spawn - wrong error caught #36897

rasjidw mannequin opened this issue Jul 15, 2002 · 2 comments
Labels
stdlib Python modules in the Lib dir

Comments

@rasjidw
Copy link
Mannequin

rasjidw mannequin commented Jul 15, 2002

BPO 581698
Nosy @loewis

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2002-07-30.14:26:24.000>
created_at = <Date 2002-07-15.14:18:55.000>
labels = ['library']
title = 'pty.spawn - wrong error caught'
updated_at = <Date 2002-07-30.14:26:24.000>
user = 'https://bugs.python.org/rasjidw'

bugs.python.org fields:

activity = <Date 2002-07-30.14:26:24.000>
actor = 'loewis'
assignee = 'none'
closed = True
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2002-07-15.14:18:55.000>
creator = 'rasjidw'
dependencies = []
files = []
hgrepos = []
issue_num = 581698
keywords = []
message_count = 2.0
messages = ['11597', '11598']
nosy_count = 2.0
nosy_names = ['loewis', 'rasjidw']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue581698'
versions = ['Python 2.2']

@rasjidw
Copy link
Mannequin Author

rasjidw mannequin commented Jul 15, 2002

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.

@rasjidw rasjidw mannequin closed this as completed Jul 15, 2002
@rasjidw rasjidw mannequin added the stdlib Python modules in the Lib dir label Jul 15, 2002
@rasjidw rasjidw mannequin closed this as completed Jul 15, 2002
@rasjidw rasjidw mannequin added the stdlib Python modules in the Lib dir label Jul 15, 2002
@loewis
Copy link
Mannequin

loewis mannequin commented Jul 30, 2002

Logged In: YES
user_id=21627

This has been fixed in CVS now with patch bpo-581705.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir
Projects
None yet
Development

No branches or pull requests

0 participants