Skip to content

Avoid leaking file handles in PythonPackage #3704

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

Merged
merged 1 commit into from
May 23, 2025

Conversation

Flamefire
Copy link
Contributor

Use read_file/write_file to avoid leaking file handles due to the missing close after open. This also improves error reporting (point to read or write)

Use read_file/write_file to avoid leaking file handles due to the missing `close` after `open`.
This also improves error reporting (point to read or write)
@boegel boegel added the bug fix label May 7, 2025
@boegel boegel added this to the 5.0.1 milestone May 7, 2025
@Flamefire
Copy link
Contributor Author

Flamefire commented May 13, 2025

Test report by @Flamefire

Overview of tested easyconfigs (in order)

  • SUCCESS Python-3.10.4-GCCcore-11.3.0.eb

Build succeeded for 1 out of 1 (1 easyconfigs in total)
julia.hpc.tu-dresden.de - Linux Rocky Linux 8.7 (Green Obsidian), x86_64, Intel(R) Xeon(R) Platinum 8276M CPU @ 2.20GHz (cascadelake), Python 3.8.13
See https://gist.github.com/Flamefire/9582c830d4e566d7acfa433abd1f4c44 for a full test report.

@boegel
Copy link
Member

boegel commented May 23, 2025

Test report by @boegel
"Failed to process easyconfig /arcanine/scratch/gent/vo/000/gvo00002/vsc40023/easybuild/easybuild-easyconfigs/easybuild/easyconfigs/m/matplotlib/matplotlib-3.9.2-gfbf-2024a.eb: Failed to obtain class for PythonBundle easyblock (not available?): cannot import name 'run_pip_check' from 'easybuild.easyblocks.generic.pythonpackage' (/tmp/eb-jlg7dvow/included-easyblocks-dyrr5dcm/easybuild/easyblocks/generic/pythonpackage.py)"
Failed during parsing of the easyconfigs, so no ecs were built (2 easyconfigs in total)
node3539.doduo.os - Linux RHEL 9.4, x86_64, AMD EPYC 7552 48-Core Processor (zen2), Python 3.9.18
See https://gist.github.com/boegel/14a2818bc4f35b35e25fe75f4604961d for a full test report.

@boegel
Copy link
Member

boegel commented May 23, 2025

Test report by @boegel
"Failed to process easyconfig /arcanine/scratch/gent/vo/000/gvo00002/vsc40023/easybuild/easybuild-easyconfigs/easybuild/easyconfigs/m/matplotlib/matplotlib-3.9.2-gfbf-2024a.eb: Failed to obtain class for PythonBundle easyblock (not available?): cannot import name 'run_pip_check' from 'easybuild.easyblocks.generic.pythonpackage' (/tmp/eb-hlgnamx6/included-easyblocks-ududp9pe/easybuild/easyblocks/generic/pythonpackage.py)"
Failed during parsing of the easyconfigs, so no ecs were built (2 easyconfigs in total)
node3539.doduo.os - Linux RHEL 9.4, x86_64, AMD EPYC 7552 48-Core Processor (zen2), Python 3.9.18
See https://gist.github.com/boegel/b46f361a66a3f656c417cde7ca3c5d33 for a full test report.

Copy link
Member

@boegel boegel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@boegel
Copy link
Member

boegel commented May 23, 2025

Test report by @boegel

Overview of tested easyconfigs (in order)

  • SUCCESS tqdm-4.66.5-GCCcore-13.3.0.eb

Build succeeded for 1 out of 1 (1 easyconfigs in total)
node3539.doduo.os - Linux RHEL 9.4, x86_64, AMD EPYC 7552 48-Core Processor (zen2), Python 3.9.18
See https://gist.github.com/boegel/bfd9c30af030c017f2c0d4337dce3519 for a full test report.

@boegel boegel merged commit f9a89fe into easybuilders:develop May 23, 2025
17 checks passed
@Flamefire Flamefire deleted the file-open branch May 23, 2025 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants