Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Process: Change the default stdin behavior from subprocess.PIPE to None #4103

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

Closed
pekkaklarck opened this issue Oct 1, 2021 · 2 comments
Closed

Comments

@pekkaklarck
Copy link
Member

We currently start processes using stdin=subprocess.PIPE by default. That typically works fine, but issue #4065 demonstrates it can cause problems with some processes. It would be better to use stdin=None by default. It would avoid problems like in #4065 and be the same as the default behavior of the underlying subprocess.Popen.

The problem with this change is that it can cause backwards compatibility problems. In most cases there's no difference, but in some case being able to write to the stdin of the started process can be handy. Our own acceptance tests use this functionality and it's possible/likely that also others are using it. We made stdin configurable in RF 4.1.2 (#4102) so if the pipe behavior is desired, stdin=PIPE can be used explicitly.

I think we can change this already in RF 5.0 because it's unlikely many users are affected and stdin=PIPE can be used explicitly. Because stdin=PIPE only works with RF 4.1.2 and newer, we may want to wait until RF 5.1, though.

@pekkaklarck
Copy link
Member Author

Better to do this change in RF 5.1 than 5.0. That gives time for those who prefer the PIPE behavior to explicitly use stidin=PIPE. Those who don't want that can already in RF 4.1.2 use stdin=None.

@pekkaklarck pekkaklarck modified the milestones: v5.0, v5.1 Oct 19, 2021
@pekkaklarck pekkaklarck modified the milestones: v5.1, v6.0 Apr 7, 2022
@pekkaklarck
Copy link
Member Author

Because users can opt-in by using stdin=None, there's no hurry to change the default. Better to do that in the next major release where backwards incompatible changes are safer. That also gives more time for users who need the current behavior to use stdin=PIPE explicitly.

@yanne yanne self-assigned this Aug 26, 2023
yanne added a commit that referenced this issue Aug 27, 2023
@yanne yanne closed this as completed in b985589 Aug 28, 2023
pekkaklarck added a commit that referenced this issue Sep 6, 2023
Includes mentioning that `stdin` default value used to be `PIPE` until
RF 7 (#4103).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants