ord(readfn(1)) TypeError: ord() expected a character, but string of length 0 found --记录

背景

从git clone 下来一个 Django 1.1项目,而本地安装是 Django 3.3 而且 使用了whoosh 出现如下问题:

 File "/usr/local/lib/python3.7/site-packages/whoosh/index.py", line 626, in check_size
    sz = stream.read_varint()
  File "/usr/local/lib/python3.7/site-packages/whoosh/filedb/structfile.py", line 191, in read_varint
    return read_varint(self.read)
  File "/usr/local/lib/python3.7/site-packages/whoosh/util/varints.py", line 102, in read_varint
    b = ord(readfn(1))
TypeError: ord() expected a character, but string of length 0 found

原因

ord()需要一个长度为1的字符串 ord(readfn(1)) 报错,

解决办法

对于背景中 场景犹豫版本不一样引起到 直接删掉 原目录到 whoosh_index ,即可解决问题,其他场景需要主管ord里面参数。里面是一个字符 不能是init类型

你可能感兴趣的:(python-Django)