renoyuan / easyofd

use python parse OFD file: finished ofd2img ofd2pdf pdf2ofd img2ofd ;(纯 python的ofd解析与pdf转换)
Apache License 2.0
159 stars 25 forks source link

Python 3.11环境报错 #21

Open NewTrees opened 1 month ago

NewTrees commented 1 month ago

1 saving xml 1_xml Traceback (most recent call last): File "D:\Laiye\CodeProjects\PythonProjects\ofdtopdf\src\test.py", line 38, in test_ofd2(ofd_file_path) File "D:\Laiye\CodeProjects\PythonProjects\ofdtopdf\src\test.py", line 19, in test_ofd2 ofd.read(ofdb64,save_xml=True, xml_name=f"{file_prefix}_xml") # 读取ofdb64 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Laiye\CodeProjects\PythonProjects\ofdtopdf\env\Lib\site-packages\easyofd\ofd.py", line 46, in read self.data = OFDParser(ofd_f)(save_xml=save_xml, xml_name=xml_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Laiye\CodeProjects\PythonProjects\ofdtopdf\env\Lib\site-packages\easyofd\parser_ofd\ofd_parser.py", line 343, in call return self.parser() ^^^^^^^^^^^^^ File "D:\Laiye\CodeProjects\PythonProjects\ofdtopdf\env\Lib\site-packages\easyofd\parser_ofd\ofd_parser.py", line 250, in parser f.write(self.get_xml_obj(SignedValue)) TypeError: write() argument must be str, not None

renoyuan commented 1 month ago

ofd 文件发我看下

NewTrees commented 1 month ago

@renoyuan 您好,我已经邮件发给您了,麻烦您看看,谢谢

renoyuan commented 1 month ago

已解决,可以尝试更新easyofd代码库再试下

NewTrees commented 1 month ago

已经转换成功,谢谢!