easyofd
easyofd copied to clipboard
Linux系统报错TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'
运行Demo文件就报错了
刚开始是报错缺字体,我在/usr/share/fonts目录下创建了myfonts文件夹,复制进去simsun.ttc、COURI.TTF和STKAITI.TTF三个字体后,再运行就报这个错误:
:~$ python3 '/home/gxxc/Downloads/demo.py'
/home/easyofd
/home
Traceback (most recent call last):
File "/home/gxxc/Downloads/demo.py", line 20, in <module>
from easyofd.ofd import OFD
File "/home/gxxc/.local/lib/python3.9/site-packages/easyofd/__init__.py", line 1, in <module>
from .ofd import OFD
File "/home/gxxc/.local/lib/python3.9/site-packages/easyofd/ofd.py", line 22, in <module>
from easyofd.draw import DrawPDF,OFDWrite
File "/home/gxxc/.local/lib/python3.9/site-packages/easyofd/draw/__init__.py", line 14, in <module>
from .draw_ofd import OFDWrite
File "/home/gxxc/.local/lib/python3.9/site-packages/easyofd/draw/draw_ofd.py", line 21, in <module>
class OFDWrite(object):
File "/home/gxxc/.local/lib/python3.9/site-packages/easyofd/draw/draw_ofd.py", line 53, in OFDWrite
def build_document_res(self, img_len: int = 0, id_obj: CurId = None, pfd_res_uuid_map: [dict|None]=None):
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'