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
bpo-33525: Add env type checking when spawn called #6910
Conversation
@@ -847,6 +848,14 @@ def _spawnvef(mode, file, args, env, func): | |||
raise TypeError('argv must be a tuple or a list') | |||
if not args or not args[0]: | |||
raise ValueError('argv first element cannot be empty') | |||
|
|||
sig = inspect.signature(func) |
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.
I don't think that it's appropriate to use inspect here. I would prefer to see the check in the caller function instead. Add an helper function if you want to factorize the code.
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.
@vstinner So you mean the validation should be placed on function which call this _spawnvef
function, right?
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.
Move the test into spawnve() and spawnvpe().
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
@Licht-T, please apply the changes that were requested in the code review. If you're not interested in following up with this, feel free to close the pull request. Thank you! |
@Licht-T, thanks for the PR! However, I'm closing this PR, for the following reasons:
If you're still interested in working on this issue, please feel free to open a new PR :) alternatively ping me and I'll happily reopen the PR |
This fixes bpo-33525.
https://bugs.python.org/issue33525