ropensci / bibtex

bibtex parser for R
https://docs.ropensci.org/bibtex/
36 stars 12 forks source link

Error message for invalid .bib files to read.bib #3

Closed mwmclean closed 9 years ago

mwmclean commented 10 years ago

I don't think this issue is any bigger than perhaps "read.bib could spit out a nicer error message for invalid input". It seems in my code I can occasionally get errors in the .bib files I generate and this would lead to "unprotect_ptr: pointer not found" errors when I try to read the bib files with read.bib. E.g.

library(bibtex)
options(error = function() traceback(2))
writeLines('Not a real bib file', 'junk.bib')
read.bib('junk.bib')`
Error in read.bib("junk.bib") : unprotect_ptr: pointer not found
In addition: Warning message:
In read.bib("junk.bib") : 
junk.bib:2:0
syntax error, unexpected $end
Dropping the entry '(nil)' (starting at line 0) 
2: .External("do_read_bib", file = file, encoding = encoding, srcfile = srcfile)
1: read.bib("junk.bib")

> sessionInfo()
R version 3.0.2 (2013-09-25)
Platform: x86_64-w64-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United 
States.1252   
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                        [5] LC_TIME=English_United States.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] bibtex_0.3-6

> R.version
               _                           
platform       x86_64-w64-mingw32          
arch           x86_64                      
os             mingw32                     
system         x86_64, mingw32             
status                                     
major          3                           
minor          0.2                         
year           2013                        
month          09                          
day            25                          
svn rev        63987                       
language       R                           
version.string R version 3.0.2 (2013-09-25)
nickname       Frisbee Sailing  
mwmclean commented 9 years ago

Fixed by commit 413662f2e70bc37ce8693da473179ed0a38cdd64