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
Unclosed file in stopwords corpora #1928
Comments
Hi, can I take this issue? |
@iliaschalkidis @alvations How can I reproduce the warning on linux? |
@sks4903440 Using version 3.2.5, you may try to run the following script in your command line: test.py
You should get:
|
Fixed in #1945 |
Hmmm.. Inheriting the And I think Python3.6 has some special requirements for files that are different from previous versions. We have to read the change log from CPython to be sure what we're doing is not just a bandaid =) |
@alvations Using |
This is tricky, the And actually, we can't really wrap the |
Any news on this? Python 3.6 still complains about NLTK 3.3, on pretty much every resource:
|
Proposed fix: #2165 |
Another issue that seems that it has been completed, it might be good to close the issue. |
Thanks everyone for raising the issue and @purificant for the fix! |
/Users/kiddo/anaconda/lib/python3.6/site-packages/nltk/corpus/reader/wordlist.py:28: ResourceWarning: unclosed file <_io.BufferedReader name='/Users/kiddo/nltk_data/corpora/stopwords/english'>
return concat([self.open(f).read() for f in fileids])
That's a warning that I found on debugging mode. I thought that maybe you would like to fix that before the next release.
The text was updated successfully, but these errors were encountered: