dlesbre / bibtex-autocomplete

Python package to autocomplete bibtex bibliographies
MIT License
85 stars 6 forks source link

Regression: uncaught error when checking DOI #12

Closed dlesbre closed 8 months ago

dlesbre commented 9 months ago

New error in 1.3:

UNEXPECTED ERROR: 
 | Uncaught exception when checking DOI resolution                                 
 | Entry = <built-in function id>
 | DOI = 10.1007/s10703-022-00405-8
 | 
 | As a result, this DOI will NOT be added to the entry
 | 
 | Traceback (most recent call last):
 |   File "/home/dorian/.local/pipx/venvs/bibtexautocomplete/lib/python3.11/site-packages/bibtexautocomplete/bibtex/fields.py", line 108, in slow_check
 |     return doi_checker.query() is True
 |            ^^^^^^^^^^^^^^^^^^^
 |   File "/home/dorian/.local/pipx/venvs/bibtexautocomplete/lib/python3.11/site-packages/bibtexautocomplete/lookups/abstract_base.py", line 114, in query
 |     return super().query()
 |            ^^^^^^^^^^^^^^^
 |   File "/home/dorian/.local/pipx/venvs/bibtexautocomplete/lib/python3.11/site-packages/bibtexautocomplete/lookups/abstract_base.py", line 94, in query
 |     return self.process_data(data)
 |            ^^^^^^^^^^^^^^^^^^^^^^^
 |   File "/home/dorian/.local/pipx/venvs/bibtexautocomplete/lib/python3.11/site-packages/bibtexautocomplete/APIs/doi.py", line 92, in process_data
 |     if self.check_url(value["data"]["value"].to_str()):
 |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 |   File "/home/dorian/.local/pipx/venvs/bibtexautocomplete/lib/python3.11/site-packages/bibtexautocomplete/APIs/doi.py", line 108, in check_url
 |     text = normalize_str_weak(final.data.decode())
 |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 |   File "/home/dorian/.local/pipx/venvs/bibtexautocomplete/lib/python3.11/site-packages/bibtexautocomplete/bibtex/normalize.py", line 58, in normalize_str_weak
 |     string = latex_to_unicode(string)
 |              ^^^^^^^^^^^^^^^^^^^^^^^^
 |   File "/home/dorian/.local/pipx/venvs/bibtexautocomplete/lib/python3.11/site-packages/bibtexparser/latexenc.py", line 65, in latex_to_unicode
 |     string = _replace_all_latex(string, itertools.chain(
 |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 |   File "/home/dorian/.local/pipx/venvs/bibtexautocomplete/lib/python3.11/site-packages/bibtexparser/latexenc.py", line 53, in _replace_all_latex
 |     string = _replace_latex(string, l.rstrip(), u)
 |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 |   File "/home/dorian/.local/pipx/venvs/bibtexautocomplete/lib/python3.11/site-packages/bibtexparser/latexenc.py", line 35, in _replace_latex
 |     if unicodedata.combining(unicod):
 |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 | TypeError: combining() argument must be a unicode character, not str
 | 
 | You can report this bug at https://github.com/dlesbre/bibtex-autocomplete/issues
 | 
UNEXPECTED ERROR: 
 | Uncaught exception when checking DOI resolution                                 
 | Entry = <built-in function id>
 | DOI = 10.1007/978-3-030-65474-0_14
 | 
 | As a result, this DOI will NOT be added to the entry
 | 
 | Traceback (most recent call last):
 |   File "/home/dorian/.local/pipx/venvs/bibtexautocomplete/lib/python3.11/site-packages/bibtexautocomplete/bibtex/fields.py", line 108, in slow_check
 |     return doi_checker.query() is True
 |            ^^^^^^^^^^^^^^^^^^^
 |   File "/home/dorian/.local/pipx/venvs/bibtexautocomplete/lib/python3.11/site-packages/bibtexautocomplete/lookups/abstract_base.py", line 114, in query
 |     return super().query()
 |            ^^^^^^^^^^^^^^^
 |   File "/home/dorian/.local/pipx/venvs/bibtexautocomplete/lib/python3.11/site-packages/bibtexautocomplete/lookups/abstract_base.py", line 94, in query
 |     return self.process_data(data)
 |            ^^^^^^^^^^^^^^^^^^^^^^^
 |   File "/home/dorian/.local/pipx/venvs/bibtexautocomplete/lib/python3.11/site-packages/bibtexautocomplete/APIs/doi.py", line 92, in process_data
 |     if self.check_url(value["data"]["value"].to_str()):
 |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 |   File "/home/dorian/.local/pipx/venvs/bibtexautocomplete/lib/python3.11/site-packages/bibtexautocomplete/APIs/doi.py", line 108, in check_url
 |     text = normalize_str_weak(final.data.decode())
 |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 |   File "/home/dorian/.local/pipx/venvs/bibtexautocomplete/lib/python3.11/site-packages/bibtexautocomplete/bibtex/normalize.py", line 58, in normalize_str_weak
 |     string = latex_to_unicode(string)
 |              ^^^^^^^^^^^^^^^^^^^^^^^^
 |   File "/home/dorian/.local/pipx/venvs/bibtexautocomplete/lib/python3.11/site-packages/bibtexparser/latexenc.py", line 65, in latex_to_unicode
 |     string = _replace_all_latex(string, itertools.chain(
 |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 |   File "/home/dorian/.local/pipx/venvs/bibtexautocomplete/lib/python3.11/site-packages/bibtexparser/latexenc.py", line 53, in _replace_all_latex
 |     string = _replace_latex(string, l.rstrip(), u)
 |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 |   File "/home/dorian/.local/pipx/venvs/bibtexautocomplete/lib/python3.11/site-packages/bibtexparser/latexenc.py", line 35, in _replace_latex
 |     if unicodedata.combining(unicod):
 |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 | TypeError: combining() argument must be a unicode character, not str
 | 
 | You can report this bug at https://github.com/dlesbre/bibtex-autocomplete/issues
 |