Whoosh(django haystack)错误IndexError:字符串索引超出范围

时间:2017-02-06 08:09:45

标签: python django django-haystack whoosh

当我在django上为django haystack运行update_index或rebuild_index时,它会抛出此错误

  File "/home/ubuntu/webapps/djangoenv/local/lib/python2.7/site-packages/django/template/base.py", line 624, in resolve
    new_obj = func(obj, *arg_vals)
  File "/home/ubuntu/webapps/djangoenv/local/lib/python2.7/site-packages/markup_deprecated/templatetags/markup.py", line 30, in textile
    return mark_safe(force_text(textile.textile(force_bytes(value), encoding='utf-8', output='utf-8')))
  File "/home/ubuntu/webapps/djangoenv/local/lib/python2.7/site-packages/textile/core.py", line 1360, in textile
    return Textile(html_type=html_type).parse(text)
  File "/home/ubuntu/webapps/djangoenv/local/lib/python2.7/site-packages/textile/core.py", line 250, in parse
    text = self.block(text)
  File "/home/ubuntu/webapps/djangoenv/local/lib/python2.7/site-packages/textile/core.py", line 465, in block
    if ext or not line[0] in whitespace:
IndexError: string index out of range

1 个答案:

答案 0 :(得分:1)

在某些版本的python-textile中它是bug。升级到最新版本。

pip install --upgrade textile