radical-cybertools / radical.saga

A Light-Weight Access Layer for Distributed Computing Infrastructure and Reference Implementation of the SAGA Python Language Bindings.
http://radical-cybertools.github.io/saga-python/
Other
83 stars 34 forks source link

Let shell_wrapper.py close file more promptly. #867

Closed eirrgang closed 1 year ago

eirrgang commented 1 year ago

With python -X dev, I frequently see output like the following.

  /home/rp/rp-venv/lib/python3.9/site-packages/radical/saga/adaptors/shell/shell_wrapper.py:11: ResourceWarning: unclosed file <_io.TextIOWrapper name='/home/rp/rp-venv/lib/python3.9/site-packages/radical/saga/adaptors/shell/shell_wrapper.sh' mode='r' encoding='UTF-8'>
    _WRAPPER_SCRIPT = open (os.path.dirname(__file__) + '/shell_wrapper.sh').read ()
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

This patch should take care of it.

codecov[bot] commented 1 year ago

Codecov Report

Merging #867 (670e3f4) into devel (523dca6) will increase coverage by 0.00%. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##            devel     #867   +/-   ##
=======================================
  Coverage   43.34%   43.35%           
=======================================
  Files          97       97           
  Lines       12727    12728    +1     
=======================================
+ Hits         5517     5518    +1     
  Misses       7210     7210           
Impacted Files Coverage Δ
src/radical/saga/adaptors/shell/shell_wrapper.py 100.00% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more