You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I only get this error on occasion and only in a production-like environment after running some code for several hours. The only thing related to nltk is that I use the MosesTokenizer.
I've tried quite a things even setting self.fp = None manually after self.close() is called, nothing worked. In the end I had to just make OpenOnDemandZipFile an alias for zipfile.ZipFile.
I'm using python 3.6 which may be the cause of the error.
File "/zhome/ff/2/77654/stdpy3/lib/python3.6/site-packages/nltk/corpus/reader/wordlist.py", line 78, in words
return [line for line in line_tokenize(self.raw(fileids))
File "/zhome/ff/2/77654/stdpy3/lib/python3.6/site-packages/nltk/corpus/reader/wordlist.py", line 28, in raw
return concat([self.open(f).read() for f in fileids])
File "/zhome/ff/2/77654/stdpy3/lib/python3.6/site-packages/nltk/corpus/reader/wordlist.py", line 28, in <listcomp>
return concat([self.open(f).read() for f in fileids])
File "/zhome/ff/2/77654/stdpy3/lib/python3.6/site-packages/nltk/corpus/reader/api.py", line 211, in open
stream = self._root.join(file).open(encoding)
File "/zhome/ff/2/77654/stdpy3/lib/python3.6/site-packages/nltk/data.py", line 511, in open
data = self._zipfile.read(self._entry)
File "/zhome/ff/2/77654/stdpy3/lib/python3.6/site-packages/nltk/data.py", line 995, in read
assert self.fp is None
The text was updated successfully, but these errors were encountered:
In fact, this is one of the major roadblock to support Python3.6, any module that uses zipfile from nltk.data would result in similar error at the assertion line.
I only get this error on occasion and only in a production-like environment after running some code for several hours. The only thing related to nltk is that I use the
MosesTokenizer
.I've tried quite a things even setting
self.fp = None
manually afterself.close()
is called, nothing worked. In the end I had to just makeOpenOnDemandZipFile
an alias forzipfile.ZipFile
.I'm using python 3.6 which may be the cause of the error.
The text was updated successfully, but these errors were encountered: