caltechlibrary / caltechdata_api

Python library for using the CaltechDATA API
Other
10 stars 3 forks source link

ex_file_links #19

Closed caseyjlaw closed 1 year ago

caseyjlaw commented 1 year ago

I'm using caltechdata_api and seem to have found a bug in caltechdata_edit versions 1.4.0 through 1.4.2. It tries to reference ex_file_links before assignment. In the code, I see an if/else clause that refers to both ex_file_links and file_links, so perhaps a variable name was changed only partially?

  File "/home/ubuntu/anaconda3/envs/casa38/lib/python3.8/site-packages/event/caltechdata.py", line 95, in edit_ctd
    caltechdata_edit(idv=idv, token=token, metadata=metadata, files=files, production=production, publish=publish)
  File "/home/ubuntu/anaconda3/envs/casa38/lib/python3.8/site-packages/caltechdata_api/caltechdata_edit.py", line 99, in caltechdata_edit
    elif ex_file_links:
UnboundLocalError: local variable 'ex_file_links' referenced before assignment
tmorrell commented 1 year ago

Thanks for the report! I just released version 1.4.3 which fixes this issue. It was a missed initialization.