-
Notifications
You must be signed in to change notification settings - Fork 3k
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 crash when sys.stdin
is None
#7118
Conversation
Hi @emilburzo! Can you please create an issue instead, providing the relevant details and ideally a way to easily reproduce this? As it stands it's very difficult to evaluate this change, and without understanding or tests it would be even harder to prevent a regression in the future. |
This was created in #7119. |
Could you please add Fix a crash when ``sys.stdin`` is set to ``None``, such as on AWS Lambda. |
Can we take the approach mentioned here, pulling the interactivity check into a separate function that can be tested in isolation? |
I'm new to the project code layout, but I can give it a go. :) I have one uncertainty though: do we want to have the new interactivity check function in the Or, because it's so generic, would it be better placed somewhere in a "higher" class? (where?) |
Thanks. :) I would put it in |
I extracted the function, feedback on naming things is very welcomed :) Is testing this feasible? I guess we could forcefully set Any thoughts? |
Hi @emilburzo! Thanks for the update. I would add a helper function and two tests in The function would take a The first test would call the helper function then make sure that The second (maybe That ensures that we're always testing the situation that would succeed except for the other changes we make for the failure test cases - this will help a lot with the other change mentioned in #7042 later. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming everything passes, this looks good to me. Thanks for your work on this @emilburzo!
and thank you @chrahunt for the hand-holding, it was very helpful! |
sys.stdin
is None
sys.stdin
is None
Hurrah! Thanks @emilburzo for the PR and @chrahunt for all the help and reviews. :) @emilburzo -- do let us know if you're interested in contributing further. There's a lot of places in pip where we could use some help! ^>^ |
@pradyunsg no promises, but I'd at least be interested to see what other things you need help with, maybe there's something I can help with. |
Fixes #7119
This happens especially on AWS Lambda.
(I did not add a news entry because it feels like a trivial change)