Skip to content
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

Close IO objects #2005

Merged
merged 3 commits into from
Jun 12, 2023
Merged

Close IO objects #2005

merged 3 commits into from
Jun 12, 2023

Conversation

sanmai-NL
Copy link
Contributor

Pull Request Checklist

  • A news fragment is added in news/ describing what is new.
  • Test cases added for changed code.

Describe what you have changed in this PR.

Close file handles. Attempt to fix e.g., these warnings.

$ pdm lock --production
python.use_venv is on, creating a virtualenv for this project...
/usr/lib/python3.11/subprocess.py:1127: ResourceWarning: subprocess 76 is still running
  _warn("subprocess %s is still running" % self.pid,
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/usr/lib/python3.11/subprocess.py:1127: ResourceWarning: subprocess 75 is still running
  _warn("subprocess %s is still running" % self.pid,
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/usr/lib/python3.11/subprocess.py:1127: ResourceWarning: subprocess 77 is still running
  _warn("subprocess %s is still running" % self.pid,
ResourceWarning: Enable tracemalloc to get the object allocation traceback
sys:1: ResourceWarning: unclosed file <_io.BufferedReader name=4>
sys:1: ResourceWarning: unclosed file <_io.BufferedReader name=6>
sys:1: ResourceWarning: unclosed file <_io.BufferedReader name=3>
sys:1: ResourceWarning: unclosed file <_io.BufferedReader name=9>
sys:1: ResourceWarning: unclosed file <_io.BufferedReader name=7>
sys:1: ResourceWarning: unclosed file <_io.BufferedReader name=11>
Virtualenv is created successfully at /opt/templatepython/.venv

@frostming
Copy link
Collaborator

Oh thanks, does it fix all the warnings you pasted in the OP?

@sanmai-NL
Copy link
Contributor Author

@frostming There are more warnings when using PYTHONDEVMODE=1 (#2004) than the one listed, warnings of various nature. I still need to look into how PDM's automated tests work and how to invoke the CLI. If you have any pointers, they'd be welcome.

@sanmai-NL sanmai-NL mentioned this pull request Jun 12, 2023
2 tasks
@frostming frostming merged commit ebfb98c into pdm-project:main Jun 12, 2023
@frostming
Copy link
Collaborator

@sanmai-NL That part definitely needs help! Thanks for your contribution.

BTW, do you think it would help if we manually close the files mentioned in #1971 ?

@j178 j178 mentioned this pull request Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants