-
Notifications
You must be signed in to change notification settings - Fork 89
Use pure python code in place of os.system #743
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
Conversation
a1f7b08 to
3782f97
Compare
3782f97 to
5149284
Compare
5149284 to
2c59a22
Compare
scripts/import_srpm.py
Outdated
| # to prevent deadlocks if the current process finishes before the previous one. | ||
| if last_process_stdout: | ||
| last_process_stdout.close() |
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 not 100% sure of the nature of the deadlock, but avoiding keeping 2 readers on the pipe is definitely a good idea. Maybe describe it like "the new process does the reading from this pipe, drop our ref to it, notably preventing deadlocks"?
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 wrote that based on an example I found, but I can't produce any deadlock, and I find plenty of examples that don't use it. I'll remove it.
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.
done
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.
It should be kept, as explained (much better) in the API doc
os.system calls the user's shell, and is not directly checking for errors. This should raise an error when cpio or rpm2cpio fail, or if they can't be found. Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
2c59a22 to
fa8bab3
Compare
os.system calls the user's shell, and is not directly checking for errors. This should raise an error when cpio or rpm2cpio fail, or if they can't be found.