question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CI: Flaky ResourceWarning('unclosed file <_io.BufferedRandom ...

See original GitHub issue

Example: https://dev.azure.com/pandas-dev/pandas/_build/results?buildId=70478&view=logs&jobId=cb04ab33-336b-54ee-68fe-dcd3abde835b&j=cb04ab33-336b-54ee-68fe-dcd3abde835b&t=0558d00d-ff4a-5538-0de9-a0e7f449700f

Previous debugging attempt: https://github.com/pandas-dev/pandas/pull/44634

Since it’s a io.BufferedRandom, it should be a file handle opened in + mode: https://github.com/pandas-dev/pandas/pull/44634#issuecomment-981260080

This only appears when tm.assert_produces_warning is called since it’s checking for extra warnings. It’s likely coming from an optional dependency at this point, but unconfirmed.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
jbrockmendelcommented, Dec 16, 2021

Logging these warnings when they pop up

2021-12-15, #44908, py39GHA, test_dialect_conflict_delimiter, <_io.BufferedRandom name=13>, (pandas/tests/io/parser/conftest.py', 22)

1reaction
mroeschkecommented, Dec 11, 2021

maybe related #44761 (comment)

Thanks, but I believe we’ve been seeing this error in the CI prior to that PR.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reportlab Image - ResourceWarning: unclosed file <_io ...
It seems that reportlab expects that you open and close the image file. Use with open(logo_path, 'rb') as image_fd: .
Read more >
python - Getting warning from unit test - SQA Stack Exchange
Just reported this problem as a new issue: ResourceWarning: unclosed file <_io.BufferedReader... in static_file(). And, until it is fixed, you ...
Read more >
Diff - platform/external/python/cpython3 - android Git repositories
So "unclosed file" resource + warnings are now correctly emitted for daemon threads. + +- Issue #19514: Deduplicate some _Py_IDENTIFIER declarations.
Read more >
Release notes for Python 3.5.4
bpo-28929: Link the documentation to its source file on GitHub. ... bpo-11453: asyncore: emit a ResourceWarning when an unclosed file_wrapper object is ...
Read more >
Issue 19829: _pyio.BufferedReader and _pyio.TextIOWrapper ...
open("/etc/issue", "rb", 0); f=None __main__:1: ResourceWarning: unclosed file <_io.FileIO name='/etc/issue' mode='rb'> >>> import io >>> f=io.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found