-
Notifications
You must be signed in to change notification settings - Fork 131
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
Use asyncio.create_subprocess
instead of subprocess.run
#235
Use asyncio.create_subprocess
instead of subprocess.run
#235
Conversation
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 made a few comments, but the comments generally need to be applied across all of the places that were switched from subprocess
to asyncio
.
Here are some additional places that were missed that should probably also be converted:
|
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.
One minor outstanding change
returncode = await proc.wait() | ||
if returncode: | ||
raise CalledProcessError(returncode=returncode, cmd=cmd) |
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.
@marczalik, here (and in other places in the PR) its seems that there are functional changes.
Before, it would return 0 == retcode
. After this PR, any tool that does not have a return code of 0 raises a CalledProcessError
. Was this change in functionality intentional?
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'm asking because this changes the behavior of ComponentExternalTool
, making it less usable.
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.
@whyitfor In general, raising CalledProcessError
for the majority of these cases is consistent with previous behavior, where the check=True
in subprocess.run()
does the same thing. (Here are the docs for reference)
However, you're correct in that this specific case , component_model.py
, and 'squashfs.py` line 30 I should not have added these. I will create a bugfix for this.
One sentence summary of this PR (This should go in the CHANGELOG!)
Use
asyncio.create_subprocess_exec
instead of blocking subprocess.run calls in packers/unpackers.Link to Related Issue(s)
#53
Please describe the changes in your request.
See above
Anyone you think should look at this, specifically?
@rbs-jacob