Xunius / Menotexport

Python solution to export annotations from your Mendeley library.
GNU General Public License v3.0
124 stars 20 forks source link

UnboundedLocalError: local variable 'folder' referenced before assignment #34

Open bholtdwyer opened 3 years ago

bholtdwyer commented 3 years ago

Here's what happens when I try to run menotexport:

First, I have to manually install pdfminer.six and bs4

Then, when I run it:

`(menotexport) Cu-Chulainn:Menotexport-master holtdwyer$ python menotexport.py -pmnrz ~/Documents/mendeley_backups/backupSlot4/holtdwyer@gmail.com@www.mendeley.com.sqlite ~/Documents/menotexport_attempt /Users/holtdwyer/opt/anaconda3/envs/menotexport/lib/python2.7/site-packages/pdfminer/init.py:20: UserWarning: On January 1st, 2020, pdfminer.six will stop supporting Python 2. Please upgrade to Python 3. For more information see https://github.com/pdfminer/pdfminer.six/issues/194 warnings.warn('On January 1st, 2020, pdfminer.six will stop supporting Python 2. Please upgrade to Python 3. For '

======================================================================

: Connected to database:

 /Users/holtdwyer/Documents/mendeley_backups/backupSlot4/holtdwyer
@gmail.com@www.mendeley.com.sqlite

================================ 1/38 ================================

: Processing folder: "basic_to_read"

------------------------------------------------------------------
# <Menotexport>: No annotations found in folder: basic_to_read

------------------------------------------------------------------
# <Menotexport>: Exporting un-annotated PDFs ...

------------------------------------------------------------------
# <Menotexport>: Exporting meta-data and annotations to .ris
file...

Traceback (most recent call last): File "menotexport.py", line 1672, in args.separate,args.zotero,args.verbose) File "menotexport.py", line 1495, in main separate,iszotero,verbose) File "menotexport.py", line 1276, in processDocs risfolder,allfolders,isfile,iszotero,iskeyword,verbose) File "/Users/holtdwyer/Downloads/Menotexport-master/lib/export2ris.py", line 298, in exportDoc2Ris risdata=parseMeta(docii,basedir,folder,isfile,iszotero,iskeyword) UnboundLocalError: local variable 'folder' referenced before assignment`

In short, it seems to break on the first folder due to a variable declaration issue.