Skip to content

ResourceWarning during collection #5342

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

Closed
blueyed opened this issue May 30, 2019 · 4 comments
Closed

ResourceWarning during collection #5342

blueyed opened this issue May 30, 2019 · 4 comments
Labels
topic: collection related to the collection phase type: bug problem that needs to be addressed

Comments

@blueyed
Copy link
Contributor

blueyed commented May 30, 2019

Using pypy3 I see this reliably (tox -e pypy3 -- -m 'not slow'):

collecting ... Exception ignored in: <_io.FileIO fd=3 mode='rb' closefd=True>
ResourceWarning: unclosed file <_io.FileIO fd=3 mode='rb' closefd=True>
collected 2422 items / 1675 deselected / 747 selected
Python 3.6.1 (784b254d669919c872a505b807db8462b6140973, May 09 2019, 13:17:30)
[PyPy 7.1.1-beta0 with GCC 8.3.0]

Not on master, and only with usedevelop = true.

@blueyed blueyed added type: bug problem that needs to be addressed topic: collection related to the collection phase labels May 30, 2019
@asottile
Copy link
Member

asottile commented Jun 1, 2019

Is this with coverage? I'm seeing similar things in pre-commit: nedbat/coveragepy#807

@blueyed
Copy link
Contributor Author

blueyed commented Jun 1, 2019

No, that was not with coverage (just -e pypy3, not -e pypy3-coverage).

@blueyed
Copy link
Contributor Author

blueyed commented Jun 1, 2019

The interesting part about nedbat/coveragepy#807 is also that you're able to catch the ResourceWarnings there, isn't it?

@blueyed
Copy link
Contributor Author

blueyed commented Jun 5, 2019

Closing as likely being a duplicate of #5317.

@blueyed blueyed closed this as completed Jun 5, 2019
vuno-bmkim pushed a commit to vuno-bmkim/importlib_metadata that referenced this issue Sep 16, 2019
pypy3 has a file-descriptor leak with `open('directory')` which
`zipp.Path(...)` triggers.  This preempts passing a directory and tickling
that.

More information:
- https://bitbucket.org/pypy/pypy/issues/3021/ioopen-directory-leaks-a-file-descriptor
- nedbat/coveragepy#807
- pytest-dev/pytest#5342
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: collection related to the collection phase type: bug problem that needs to be addressed
Projects
None yet
Development

No branches or pull requests

2 participants