jaraco / pip-run

pip-run - dynamic dependency loader for Python
MIT License
135 stars 20 forks source link

ResourceWarning in PathReader #56

Closed jaraco closed 2 years ago

jaraco commented 2 years ago

When attempting to use pip-run in Setuptools tests, which turn warnings into errors, I see this error:

E               pytest.PytestUnraisableExceptionWarning: Exception ignored in: <_io.FileIO [closed]>
E               
E               Traceback (most recent call last):
E                 File "/Users/jaraco/code/public/pypa/setuptools/.tox/python/lib/python3.10/site-packages/pip_run/launch.py", line 64, in _build_env
E                   joined = os.pathsep.join(items)
E               ResourceWarning: unclosed file <_io.TextIOWrapper name='/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-run-71fkg9i3/distutils-precedence.pth' mode='r' encoding='UTF-8'>

.tox/python/lib/python3.10/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning

It seems that Python warns when using open without its context manager, such as here.