-
-
Notifications
You must be signed in to change notification settings - Fork 308
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
pythonlib: Fix ResourceWarning in libgrass_interface_generator/ctypesgen/version.py #4288
Conversation
Co-authored-by: Edouard Choinière <27212526+echoix@users.noreply.github.com>
devnull = open(os.devnull, "w") | ||
p = Popen(["git", "describe"], stdout=PIPE, stderr=devnull, **args) | ||
with open(os.devnull, "w") as devnull: | ||
p = Popen(["git", "describe"], stdout=PIPE, stderr=devnull, **args) |
Check notice
Code scanning / Bandit
Starting a process with a partial executable path Note
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.
We shouldn't waste time on non-crucial fixes here on ctypesgen, with next update from upstream, they will be null-and-void (see https://github.com/OSGeo/grass/blob/main/python/libgrass_interface_generator/README.md).
Do you know if upstream is planning to make a release real soon? |
It looks like it's pretty much up to me unfortunately, as I'm the only active with enough access rights. So, probably not "real" soon. Still, these kind of changes are not urgent. |
Would you want these changes in a PR in the upstream repo so they could be there when ready? |
@echoix just wanted to confirm if these are still required. If not, I'll close this PR |
We might as well close them. But they still exist to search again at some point. It's kinda sad, but otherwise it'll end up like one of the 130 other pending PRs |
This pull request addresses the recurring
ResourceWarning
about an unclosed file in the version.py script. The following changes have been made:Path(VERSION_FILE).write_text(v)
which fixes the FURB103 warning generated further as pointed out here: Fix Flake8 errors and improve exception handling in lib/init/grass.py. Fixes ResourceWarning for python/libgrass_interface_generator/ctypesgen/version.py #4285 (comment)These changes should resolve the ResourceWarnings in this particular case