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

The preexec_fn should be executed before closing the file descriptors. #55

Open
eldipa opened this issue Dec 9, 2019 · 0 comments
Open

Comments

@eldipa
Copy link

eldipa commented Dec 9, 2019

Currently, the preexec_fn is executed after the file descriptors are closed. This has some unwanted effects:

The proposal is to move the "close the fds" section below the "execute the preexec_fn" code: https://github.com/pexpect/ptyprocess/blob/master/ptyprocess/ptyprocess.py#L266-L285

For reference, this is what it does subprocess.Popen: https://github.com/python/cpython/blob/master/Modules/_posixsubprocess.c#L528-L549

If it is okay, I can do a PR with the fix but I would like to hear your opinions about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant