Skip to content

Fix un-closed file when opening stop_words_file.#33

Open
RUI-LONG wants to merge 1 commit intoletiantian:masterfrom
RUI-LONG:master
Open

Fix un-closed file when opening stop_words_file.#33
RUI-LONG wants to merge 1 commit intoletiantian:masterfrom
RUI-LONG:master

Conversation

@RUI-LONG
Copy link

@RUI-LONG RUI-LONG commented Sep 4, 2021

Warning detail:
ResourceWarning: unclosed file <_io.BufferedReader name='D:\Anaconda\envs\know\lib\site-packages\textrank4zh\stopwords.txt'>
for word in codecs.open(self.stop_words_file, 'r', 'utf-8', 'ignore'):

What I have done:
Simply called close to stop_words_file.

Warning detail:
ResourceWarning: unclosed file <_io.BufferedReader name='D:\Anaconda\envs\know\lib\site-packages\textrank4zh\stopwords.txt'>
for word in codecs.open(self.stop_words_file, 'r', 'utf-8', 'ignore'):

What I have done:
Simply called close to stop_words_file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant