disable pylint W1509 subprocess-popen-preexec-fn#5
Merged
Conversation
I'm not sure how to work around boot-qemu.py:768:17: W1509: Using preexec_fn keyword which may be unsafe in the presence of threads (subprocess-popen-preexec-fn) For python 3.10.8. I might be able to use process_group=1 in the subprocess.Popen constructor, but seems it's only available in python 3.11+. Link: ClangBuiltLinux/boot-utils#87
nathanchance
approved these changes
Dec 16, 2022
nathanchance
left a comment
Member
There was a problem hiding this comment.
I do not really have a strong opinion on this vs. just disabling it locally with a # pylint: disable-next=subprocess-popen-preexec-fn. It seems unlikely that we will ever use another preexec_fn argument again but who knows...
nickdesaulniers
added a commit
to ClangBuiltLinux/boot-utils
that referenced
this pull request
Dec 16, 2022
not sure why presubmits aren't using ClangBuiltLinux/actions-workflows#5
nathanchance
added a commit
to nathanchance/boot-utils
that referenced
this pull request
Aug 18, 2023
This is the same warning from pylint that was disabled in ClangBuiltLinux/actions-workflows#5. boot-qemu.py:216:35: PLW1509 `preexec_fn` argument is unsafe when using threads 'preexec_fn' is on the path towards deprecation, so workaround this warning by refactoring the code to use the new keyword argument 'process_group' when using Python 3.11 and newer, which makes it clear that we don't need 'preexec_fn' longterm. This conveniently hides the 'preexec_fn' use in Popen() so there is no more warning. Link: https://beta.ruff.rs/docs/rules/subprocess-popen-preexec-fn/ Signed-off-by: Nathan Chancellor <nathan@kernel.org>
nathanchance
added a commit
to nathanchance/boot-utils
that referenced
this pull request
Aug 18, 2023
This is the same warning from pylint that was disabled in ClangBuiltLinux/actions-workflows#5. boot-qemu.py:216:35: PLW1509 `preexec_fn` argument is unsafe when using threads 'preexec_fn' is on the path towards deprecation, so workaround this warning by refactoring the code to use the new keyword argument 'process_group' when using Python 3.11 and newer, which makes it clear that we don't need 'preexec_fn' longterm. This conveniently hides the 'preexec_fn' use in Popen() so there is no more warning. Link: https://beta.ruff.rs/docs/rules/subprocess-popen-preexec-fn/ Signed-off-by: Nathan Chancellor <nathan@kernel.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'm not sure how to work around
boot-qemu.py:768:17: W1509: Using preexec_fn keyword which may be unsafe in the presence of threads (subprocess-popen-preexec-fn)
For python 3.10.8. I might be able to use process_group=1 in the subprocess.Popen constructor, but seems it's only available in python 3.11+.
Link: ClangBuiltLinux/boot-utils#87