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

should pty.openpty() set pty/tty inheritable? #80784

Open
cagney mannequin opened this issue Apr 11, 2019 · 1 comment
Open

should pty.openpty() set pty/tty inheritable? #80784

cagney mannequin opened this issue Apr 11, 2019 · 1 comment
Labels

Comments

@cagney
Copy link
Mannequin

cagney mannequin commented Apr 11, 2019

BPO 36603
Nosy @Yhg1s, @cagney

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 = None
created_at = <Date 2019-04-11.15:17:03.564>
labels = ['3.7', 'expert-IO']
title = 'should pty.openpty() set pty/tty inheritable?'
updated_at = <Date 2019-04-11.16:20:58.800>
user = 'https://github.com/cagney'

bugs.python.org fields:

activity = <Date 2019-04-11.16:20:58.800>
actor = 'hugh'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['IO']
creation = <Date 2019-04-11.15:17:03.564>
creator = 'cagney'
dependencies = []
files = []
hgrepos = []
issue_num = 36603
keywords = []
message_count = 1.0
messages = ['339982']
nosy_count = 3.0
nosy_names = ['twouters', 'cagney', 'hugh']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = None
url = 'https://bugs.python.org/issue36603'
versions = ['Python 3.7']

@cagney
Copy link
Mannequin Author

cagney mannequin commented Apr 11, 2019

pty.openpty(), on systems with a working os.openpty() / openpty(3) executes:

if (openpty(&master_fd, &slave_fd, NULL, NULL, NULL) != 0)
    goto posix_error;
if (_Py_set_inheritable(master_fd, 0, NULL) < 0)
    goto error;
if (_Py_set_inheritable(slave_fd, 0, NULL) < 0)
    goto error;

where as on systems where this is fails it instead executes:

master_fd, slave_name = _open_terminal()
slave_fd = slave_open(slave_name)
    i.e., result = os.open(tty_name, os.O_RDWR)
return master_fd, slave_fd

where os.open() was "Changed in version 3.4: The new file descriptor is now non-inheritable."

(personally I'd deprecate pty.openpty(), but that is just me)

@cagney cagney mannequin added 3.7 (EOL) end of life topic-IO labels Apr 11, 2019
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

0 participants