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

Cache sys.stdout instead of assuming it is equal to sys.__stdout__ #1329

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Nihlus
Copy link

@Nihlus Nihlus commented Jan 11, 2025

When running under Mitogen, ipa_server and ipa_replica breaks execution by overwriting sys.stdout with sys.stdout.

With Mitogen, sys.stdout != sys.stdout at this point in the code, and changing it in this manner results in access to closed file descriptors for future invocations. Generally, it is recommended not to use sys.stdout and instead explicitly cache the current value of sys.stdout as proposed in this PR.

@Nihlus
Copy link
Author

Nihlus commented Jan 11, 2025

The issue has also been reported in Mitogen (mitogen-hq/mitogen#1214) since it is divergent behaviour against stock Ansible, but it's still something easily fixed in this module.

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

Successfully merging this pull request may close these issues.

1 participant