-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Closed
Labels
bugIssue described a bugIssue described a bugdifficulty mediumMedium issue: required good gensim understanding & python skillsMedium issue: required good gensim understanding & python skills
Description
Into
We have some "weird" behavior if a user passes a file-like object to MmCorpus, based on this mailing list thread
Demonstration
from gensim.corpora import MmCorpus
import bz2
f = bz2.BZ2File("testcorpus.mm.bz2")
print(f.closed) # 0
corpus = MmCorpus(f)
print(f.closed) # 1 ???What happens
File-like object was closed when we call MmReader, problem located here
with automatically close file-like when we out of scope, this is OK if we open this file, but we shouldn't close file-like passed from user.
Related PR #1867
UPD: another problem here - call IndexCopus.__init__, that didn't support file-like object at all.
piskvorky
Metadata
Metadata
Assignees
Labels
bugIssue described a bugIssue described a bugdifficulty mediumMedium issue: required good gensim understanding & python skillsMedium issue: required good gensim understanding & python skills