Issue 15 in gpapers: Import DOI freezes on bibtex parsing

10 views
Skip to first unread message

codesite...@google.com

unread,
Aug 13, 2012, 11:20:49 PM8/13/12
to gpapers...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 15 by 98310b...@gmail.com: Import DOI freezes on bibtex parsing
http://code.google.com/p/gpapers/issues/detail?id=15

What steps will reproduce the problem?
1. Select File -> Import DOI... and enter 10.1086/648726
2. Press OK and wait.

What is the expected output? What do you see instead?
This should download a paper from the journal "Clinical Infectious
Diseases". Instead, the job appears to go through (the busy spinner stops)
and the GUI refuses to respond until forcibly closed and restarted. Upon
restarting, a blank entry is visible with the correct DOI and an incorrect
PDF.

What version of the product are you using? On what operating system?
I am using the latest version from git (1dbb66ebecfb) on Ubuntu 12.04. I
have pyparsing version 1.5.2-2ubuntu1 installed through my package manager.

Please provide any additional information below.

I haven't figured out what causes this bug, but when I run gpapers in a
debugger, I can see that it gets stuck calling into the pyparsing library
at line 146 of the importer.bibtex module (method parse_string(str)). I'm
guessing there is either a bug in your grammar or a bug in the pyparsing
module, but I am not certain, since I've never used that library.

I attached a literal copy of the string being parsed. Maybe the newline
characters in the title are the problem?


Attachments:
problematic_bibtex.txt 777 bytes

codesite...@google.com

unread,
Aug 14, 2012, 4:23:33 AM8/14/12
to gpapers...@googlegroups.com
Updates:
Status: Accepted
Owner: marcelCo...@gmail.com

Comment #1 on issue 15 by marcelCo...@gmail.com: Import DOI freezes on
bibtex parsing
http://code.google.com/p/gpapers/issues/detail?id=15

Thanks for the report -- I can reproduce the problem by pasting the bibtex
into the "Import BibTeX" window, gpapers goes into an infinite loop,
apparently...

The issue seems to be that the BibTeX file is malformed: The key "van
Thiel_Leenstra_Kager_de Vries_van Vugt_van der Meide_Bart_Zeegelaar_van der
Sluis_Schallig_et al._2010" contains spaces. The minimal solution would be
to bail out with an error message -- a better one would be to be a bit more
forgiving in the parsing or alternatively to allow the user to correct the
problem.

codesite...@google.com

unread,
Aug 15, 2012, 7:07:28 PM8/15/12
to gpapers...@googlegroups.com
Updates:
Status: Fixed

Comment #2 on issue 15 by marcelCo...@gmail.com: Import DOI freezes on
bibtex parsing
http://code.google.com/p/gpapers/issues/detail?id=15

This issue was closed by revision 7f0168f814fa.

codesite...@google.com

unread,
Aug 18, 2012, 6:16:40 PM8/18/12
to gpapers...@googlegroups.com

Comment #3 on issue 15 by 98310b...@gmail.com: Import DOI freezes on bibtex
parsing
http://code.google.com/p/gpapers/issues/detail?id=15

You're right about those spaces being the problem. I tried replacing them
with underscores and using the "Import from BibTeX..." window, and the
paper gets imported correctly. There are still some formatting issues with
the imported data, but that looks like it may be a different problem.

Maybe the BibTeX key could be sanitized automatically? I'll take a closer
look later and see if that's possible.

Reply all
Reply to author
Forward
0 new messages