Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax error from a very specific DOI #20

Closed
msyriac opened this issue Feb 17, 2020 · 2 comments · Fixed by #21
Closed

Syntax error from a very specific DOI #20

msyriac opened this issue Feb 17, 2020 · 2 comments · Fixed by #21

Comments

@msyriac
Copy link

msyriac commented Feb 17, 2020

Stumped by this error

$ adstex test.tex 

------------------------------------------------------------
Auto-identifying bibtex files...
Main bibtex source (output file): bib.bib

------------------------------------------------------------
Traceback (most recent call last):
  File "/home/msyriac/.local/bin/adstex", line 8, in <module>
    sys.exit(main())
  File "/home/msyriac/.local/lib/python3.8/site-packages/adstex.py", line 394, in main
    bibcode_new = entry2bibcode(bib.entries_dict[key])
  File "/home/msyriac/.local/lib/python3.8/site-packages/adstex.py", line 259, in entry2bibcode
    id_this = id2bibcode(unquote(entry[field_name]), possible_id_types)
  File "/home/msyriac/.local/lib/python3.8/site-packages/adstex.py", line 164, in id2bibcode
    return next(s).bibcode
  File "/home/msyriac/.local/lib/python3.8/site-packages/ads/search.py", line 501, in __next__
    self.execute()
  File "/home/msyriac/.local/lib/python3.8/site-packages/ads/search.py", line 532, in execute
    self.response = SolrResponse.load_http_response(
  File "/home/msyriac/.local/lib/python3.8/site-packages/ads/base.py", line 94, in load_http_response
    raise APIResponseError(http_response.text)
ads.exceptions.APIResponseError: '{"responseHeader":{"status":400,"QTime":0,"params":{"q":"identifier:10.1051/0004-6361:20066170","fl":"id,bibcode","cursorMark":"*","start":"0","internal_logging_params":"X-Amzn-Trace-Id=Root=1-5e4abdd3-c8b04fc0540672306bd26010","sort":"score desc,id desc","rows":"50","wt":"json"}},"error":{"metadata":["error-class","org.apache.solr.common.SolrException","root-error-class","java.lang.Exception"],"msg":"org.apache.solr.search.SyntaxError: INVALID_SYNTAX_CANNOT_PARSE: Syntax Error, cannot parse identifier:10.1051/0004-6361:20066170: The parser reported a syntax error, antlrqueryparser hates errors! ","code":400}}\n'

that can be reproduced whenever a bib entry with a very specific DOI exists:

@article{Test,                                                                                                                        
 author = {{Test.}},                                                                                                                  
 doi = {10.1051/0004-6361:20066170},                                                                                                  
}  

(All other cites in my tex file worked, so thanks for making this!)

@yymao
Copy link
Owner

yymao commented Feb 17, 2020

Thank you for the report! I'm working on a fix in #21. Once I test it I'll make a new release on pip.

@yymao yymao closed this as completed in #21 Feb 17, 2020
yymao added a commit that referenced this issue Feb 17, 2020
Put identifier in quotes to escape colon
@yymao
Copy link
Owner

yymao commented Feb 17, 2020

@msyriac You should be able to update to v0.3.7 in a moment and it should now work for this DOI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants