Skip to content

TST: remove ResourceWarnings #12897

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
jreback opened this issue Apr 14, 2016 · 2 comments
Closed

TST: remove ResourceWarnings #12897

jreback opened this issue Apr 14, 2016 · 2 comments
Labels
IO CSV read_csv, to_csv IO Data IO issues that don't fit into a more specific label Testing pandas testing functions or related to the test suite

Comments

@jreback
Copy link
Contributor

jreback commented Apr 14, 2016

So just enabled ResourceWarnings to show up (these are only on PY3), see a sample run here; they are only enabled on the 3.5-dev build (you can manually enable by setting PANDAS_TESTING_MODE="deprecate"

These are unclosed filehandles mostly in the read_csv tests.

So there are 2 cases here which need to be dealt with:

  • when we uncompress things, we create a wrapper around the decompressor, these need to be closed, ONLY if the original handle was a string (IOW a pth), and NOT a filehandle itself (which we need to leave open)
  • when we have a utf-16 encoding we create a UTFReader object which needs to be closed (but same as above, you can't close it if the original handle was open to begin with)

So I added some .close() methods to the readers, but they are not explicity called anywhere. We need to figure out when to do this.

This might be a bit non-trivial!

@jreback jreback added IO Data IO issues that don't fit into a more specific label IO CSV read_csv, to_csv Difficulty Advanced labels Apr 14, 2016
@jreback jreback added this to the Next Major Release milestone Apr 14, 2016
@jreback jreback added the Testing pandas testing functions or related to the test suite label Apr 14, 2016
@gfyoung
Copy link
Member

gfyoung commented Aug 20, 2016

@jreback: IINM, this issue was fixed in #13940.

@jreback
Copy link
Contributor Author

jreback commented Aug 20, 2016

right

@jreback jreback closed this as completed Aug 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO CSV read_csv, to_csv IO Data IO issues that don't fit into a more specific label Testing pandas testing functions or related to the test suite
Projects
None yet
Development

No branches or pull requests

2 participants