SUSYUSTC / MathTranslate

translate scientific papers in latex, especially arxiv papers
https://github.com/SUSYUSTC/MathTranslate
Apache License 2.0
1.04k stars 69 forks source link

get_file_encoding error #88

Open rotcx opened 8 months ago

rotcx commented 8 months ago

arxiv number: 1612.02523 temporary directory /var/folders/xz/b53crnzx71j3q8q7fh6qch400000gp/T/tmpmt9nyn04 This is a pure text file main tex files found: Traceback (most recent call last): File "/usr/local/bin/translate_arxiv", line 8, in sys.exit(main()) File "/usr/local/lib/python3.7/site-packages/mathtranslate/translate_arxiv.py", line 221, in main raise e File "/usr/local/lib/python3.7/site-packages/mathtranslate/translate_arxiv.py", line 211, in main success = translate_dir('.', options) File "/usr/local/lib/python3.7/site-packages/mathtranslate/translate_arxiv.py", line 111, in translate_dir content = open(path, encoding=input_encoding).read() File "/usr/local/Cellar/python@3.7/3.7.12/Frameworks/Python.framework/Versions/3.7/lib/python3.7/codecs.py", line 322, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa1 in position 67479: invalid start byte


arxiv number: 1612.02523 temporary directory /var/folders/xz/b53crnzx71j3q8q7fh6qch400000gp/T/tmpwz89rjiv download completed... This is a pure text file main tex files found: Traceback (most recent call last): File "/usr/local/bin/translate_arxiv", line 8, in sys.exit(main()) File "/usr/local/lib/python3.7/site-packages/mathtranslate/translate_arxiv.py", line 221, in main raise e File "/usr/local/lib/python3.7/site-packages/mathtranslate/translate_arxiv.py", line 211, in main success = translate_dir('.', options) File "/usr/local/lib/python3.7/site-packages/mathtranslate/translate_arxiv.py", line 110, in translate_dir input_encoding = get_file_encoding(path) File "/usr/local/lib/python3.7/site-packages/mathtranslate/encoding.py", line 21, in get_file_encoding if result['confidence'] < 0.9: TypeError: '<' not supported between instances of 'NoneType' and 'float'

image