I/O operation on closed file

44 views
Skip to first unread message

Alejandro Torrado

unread,
Apr 26, 2013, 1:58:39 PM4/26/13
to who...@googlegroups.com
Hi, I have this error when doing some queries. I couldn't determine yet which kind of things trigger this problem. Do you have a clue?

Thanks

Traceback (most recent call last):
  .....
  File "/usr/lib/python2.7/dist-packages/whoosh/searching.py", line 1784, in __repr__
    return "<%s %r>" % (self.__class__.__name__, self.fields())
  File "/usr/lib/python2.7/dist-packages/whoosh/searching.py", line 1670, in fields
    self._fields = self.searcher.stored_fields(self.docnum)
  File "/usr/lib/python2.7/dist-packages/whoosh/filedb/filereading.py", line 156, in stored_fields
    in iteritems(self.storedfields[docnum])
  File "/usr/lib/python2.7/dist-packages/whoosh/filedb/filetables.py", line 796, in __getitem__
    dbfile.seek(start)
ValueError: I/O operation on closed file

Philippe Ombredanne

unread,
Apr 27, 2013, 3:57:41 AM4/27/13
to who...@googlegroups.com


On Apr 26, 2013 7:58 PM, "Alejandro Torrado" <aleto...@gmail.com> wrote:
> Hi, I have this error when doing some queries. I couldn't determine yet which kind of things trigger this problem. Do you have a clue?

Can you post the code to trigger this in a pastebin?

Sai Manoj Kumar Yadlapati

unread,
Aug 31, 2013, 1:13:08 PM8/31/13
to who...@googlegroups.com

Matt Chaput

unread,
Aug 31, 2013, 3:07:19 PM8/31/13
to who...@googlegroups.com
A Results object can't be used after the Searcher object is closed. Sorry, the current code has a better error message about this :/

You'll need to either restructure your code to not close the searcher until you're done with the results, or copy the information you need into another structure before you close it.

Hope this helps,

Matt

Reply all
Reply to author
Forward
0 new messages