Issue #214 new

EOFError: EOF read where object expected

Anonymous created an issue

I am getting eof error on indexing .Below is the code used: {{{

!python

def add_docs_to_writer(wri) : files=os.listdir(data_folder) for filename in files : fileobj=open(data_folder+filename, "rb") content=fileobj.read() fileobj.close() title=re.split(".",filename)[0] """print(title)""" wri.add_document(title=title,content=str(content),path=data_folder+filename) return wri;

def get_index(dir=index_dir): return open_dir(dir)

def init_index(dir=index_dir) : schema = make_schema() ix = create_in(dir, schema)

def build_index(dir=index_dir) : init_index() ix = open_dir(dir)
writer = ix.writer() add_docs_to_writer(writer) writer.commit(merge=False) }}} following is the traceback Traceback (most recent call last): File ".\make_index_script.py", line 2, in <module> index_builder.build_index() File "D:\IR\Assignment 1\index_builder.py", line 36, in build_index writer.commit(merge=False) File "C:\Python31\lib\site-packages\whoosh-2.3.2-py3.1.egg\whoosh\filedb\filewriting.py", line 512, in commit self.lengthfile) File "C:\Python31\lib\site-packages\whoosh-2.3.2-py3.1.egg\whoosh\filedb\pools.py", line 289, in finish termswriter.add_iter(postiter, lengths.get) File "C:\Python31\lib\site-packages\whoosh-2.3.2-py3.1.egg\whoosh\filedb\filewriting.py", line 634, in add_iter for fieldname, text, docnum, weight, valuestring in postiter: File "C:\Python31\lib\heapq.py", line 332, in merge h_append([next(), itnum, next]) File "C:\Python31\lib\site-packages\whoosh-2.3.2-py3.1.egg\whoosh\filedb\pools.py", line 103, in read_run buff.append(load(f)) EOFError: EOF read where object expected

Comments (1)

  1. Thomas Waldmann

    it doesn't look like the code you posted is complete.

    could you try to produce a complete, but minimal code example that reproduces the problem?

    also, if you can still edit the original text of this issue, maybe reformat the traceback, so it is better readable.

  2. Log in to comment