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

CLN: resource warnings #13932

Closed
jreback opened this issue Aug 8, 2016 · 4 comments
Closed

CLN: resource warnings #13932

jreback opened this issue Aug 8, 2016 · 4 comments
Labels
Clean IO CSV read_csv, to_csv IO Stata read_stata, to_stata
Milestone

Comments

@jreback
Copy link
Contributor

jreback commented Aug 8, 2016

https://travis-ci.org/pydata/pandas/jobs/150623749

so we have warnings enabled on the 3.5/dev build. Lots of resource warnings....

@jreback jreback added this to the Next Major Release milestone Aug 8, 2016
@jreback
Copy link
Contributor Author

jreback commented Aug 8, 2016

@gfyoung an odd one here.

................................./home/travis/build/pydata/pandas/pandas/io/parsers.py:1904: FutureWarning: split() requires a non-empty pattern match.
  yield pat.split(line.strip())

@jreback jreback added IO CSV read_csv, to_csv IO Stata read_stata, to_stata labels Aug 8, 2016
@gfyoung
Copy link
Member

gfyoung commented Aug 8, 2016

That's due to a regex matching the empty string somewhere in one of the tests. Can try to patch that.

As for the other ResourceWarnings, I think it's because files are being closed before being destroyed, but in this instance, not sure why that would be happening given our test construction.

@jreback
Copy link
Contributor Author

jreback commented Aug 8, 2016

these only happen in PY3 fyi. Maybe its more strict.

@gfyoung
Copy link
Member

gfyoung commented Aug 8, 2016

Yes, it's because that warning was introduced in Python 3. Again, not 100% sure why they are occurring, since that implies that the file object is getting deleted before it is closed, and we're using with statements everywhere in the tests.

@jreback jreback closed this as completed in e89a0a0 Aug 9, 2016
jreback pushed a commit that referenced this issue Aug 11, 2016
closes #13932

Author: agraboso <agraboso@gmail.com>

Closes #13940 from agraboso/fix-13932 and squashes the following commits:

3fa7d25 [agraboso] Close open files in TextFileReader upon StopIteration
6592c73 [agraboso] Do not acquire list as file handler to close
7aa5184 [agraboso] Properly close opened files in XportReader and SAS7BDATReader
240383c [agraboso] Properly close opened files in two tests
52d1073 [agraboso] Fix linting error
39dcd99 [agraboso] Fix rebase
75fc34d [agraboso] Make try/except blocks in StataReader.read as small as possible
812e6ec [agraboso] Fix long line
c7e9c9c [agraboso] On close, CParserWrapper must call self._reader.close()
99e16dd [agraboso] Fix whatsnew entries
30b61e6 [agraboso] Properly close opened files in StataWriter
3b0f25f [agraboso] Properly close opened files in StataReader
1e39a5e [agraboso] Properly close opened files in three tests
d759156 [agraboso] BUG: properly close files opened by parsers
@jreback jreback modified the milestones: 0.19.0, Next Major Release Aug 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean IO CSV read_csv, to_csv IO Stata read_stata, to_stata
Projects
None yet
2 participants