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

Make closing stdin optional? #22

Closed
nicolaskruchten opened this issue Feb 5, 2019 · 3 comments

Comments

2 participants
@nicolaskruchten
Copy link
Contributor

commented Feb 5, 2019

For the module I'm working on, this defensive line is actually breaking things because a dependency of a dependency is checking if stdin is open: https://github.com/pdoc3/pdoc/blob/master/pdoc/cli.py#L285

Would it be possible to allow this behaviour to be turned off via a flag or environment variable? If you'd accept such a PR I'd be happy to contribute it :)

@kernc

This comment has been minimized.

Copy link
Contributor

commented Feb 5, 2019

I'm not entirely sure why it was introduced in the first place; I'd likely prefer to consider modules messing with stdin outside their __name__ == '__main__' block wholly misbehaved.

I think it would be acceptable to make the default remain open and only close it upon --close-stdin.

@nicolaskruchten

This comment has been minimized.

Copy link
Contributor Author

commented Feb 5, 2019

I agree that these modules are misbehaving, but I can't really control dependencies of dependencies :) I'll try to get a PR in today, leaving the current behaviour on by default but allowing for it to be disabled.

@kernc

This comment has been minimized.

Copy link
Contributor

commented Feb 6, 2019

I'm happy with inverting the default. We've made some best-effort incompatibility changes recently, so this won't strike anyone as odd. Times were different when this was introduced. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.