-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
Fix #31694: running with closed stdin on python 3 #31695
Conversation
Alternative to #31586. |
Could this change have caused the https://app.shippable.com/github/ansible/ansible/runs/40761/24/console failure or is that merely a fluke? |
@adelton I just re-triggered the shippable job, we'll see... |
@mkrizek, what is the best course of action to get this PR reviewed and merged? |
Overall change looks good, but it seems a little clunky to check for closed file descriptor for stdin twice. Perhaps structure the change like this: [...]
fd = None
try:
if PY3:
fd = self._connection._new_stdin.buffer.fileno()
else:
fd = self._connection._new_stdin.fileno()
except (ValueError, AttributeError):
# ValueError: someone is using a closed file descriptor as stdin
[...] |
The problem is, that So we cannot just skip the assignment to |
Okay. I think we should still combine the try excepts, then but assign to
stdin inside of the try: except block as well.
|
SUMMARY
Fixes #31694.
When stdin is
/dev/null
,self._connection._new_stdin.buffer
fails withAttributeError
.This amends #26495.
ISSUE TYPE
COMPONENT NAME
./lib/ansible/plugins/action/pause.py
ANSIBLE VERSION
ADDITIONAL INFORMATION
Before:
After: