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

list index out of range when using WorksContainer #106

Closed
IvanSterligov opened this issue May 6, 2022 · 4 comments
Closed

list index out of range when using WorksContainer #106

IvanSterligov opened this issue May 6, 2022 · 4 comments
Labels
Milestone

Comments

@IvanSterligov
Copy link

IvanSterligov commented May 6, 2022

hi there, and thank you for your useful library!

I'm using the latest habanero build (pip installed today) and get an error when trying to put results in a WorkContainer

from habanero import Crossref, WorksContainer
cr = Crossref(mailto = "(my email)")
res = cr.works(query_affiliation='Higher School of Economics*', cursor='*', works=True, cursor_max=500, progress_bar=True)
x=WorksContainer(res)
print(x)

Traceback (most recent call last):
File "xxx.py", line 4, in
x=WorksContainer(res)
File "xxx\Python310\lib\site-packages\habanero\crossref\workscontainer.py", line 44, in init
keys = list(self.works[0].keys())
IndexError: list index out of range

@sckott
Copy link
Owner

sckott commented May 6, 2022

thanks for the issue @IvanSterligov

yep, i get the same error. its possible i didn't make sure WorksContainer worked with results of a cursor, i'll have a look

@sckott sckott added the bug label May 6, 2022
@sckott sckott added this to the 2.0 milestone May 6, 2022
sckott added a commit that referenced this issue May 6, 2022
@sckott
Copy link
Owner

sckott commented May 6, 2022

@IvanSterligov can you reinstall from github and try again?

@IvanSterligov
Copy link
Author

thanks for a quick fix! now it's working.

btw I had to modify your recommended git setup line

this one is not ok for me:
pip (or pip3) install git+git://github.com/sckott/habanero.git#egg=habanero

this one is ok:
pip (or pip3) install git+https://github.com/sckott/habanero.git#egg=habanero

the reason: https://github.blog/2021-09-01-improving-git-protocol-security-github/

@sckott
Copy link
Owner

sckott commented May 11, 2022

thanks for the note about install. fixed now in 7d652e1

@sckott sckott modified the milestones: v2.0, v1.2.2 May 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants