You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error Raised: TypeError: list indices must be integers, not unicode #3
You are creating really nice tools. Recently when I use the title2bib to search for literature by title, it gives error like the following:
command: $title2bib 'Nanotwinned diamond with unprecedented hardness and stability'
error message:
Traceback (most recent call last):
File "/usr/local/bin/title2bib", line 85, in <module>
main()
File "/usr/local/bin/title2bib", line 71, in main
found, bib = get_bib_from_title(title, get_first)
File "/usr/local/lib/python2.7/site-packages/title2bib/crossref.py", line 86, in get_bib_from_title
found, item = get_from_title(title, get_first)
File "/usr/local/lib/python2.7/site-packages/title2bib/crossref.py", line 50, in get_from_title
items = r.json()["message"]["items"]
TypeError: list indices must be integers, not unicode
I am using python 2.7.15 on Mac OSX. The command works well a few weeks ago.
I also tried to update title2bib to version 0.4.0 using pip, but still have the issue.
raceback (most recent call last):
File "/home/user/bin/title2bib", line 85, in <module>
main()
File "/home/user/bin/title2bib", line 71, in main
found, bib = get_bib_from_title(title, get_first)
File "/home/user/lib/python3.7/site-packages/title2bib/crossref.py", line 86, in get_bib_from_title
found, item = get_from_title(title, get_first)
File "/home/user/lib/python3.7/site-packages/title2bib/crossref.py", line 50, in get_from_title
items = r.json()["message"]["items"]
TypeError: list indices must be integers or slices, not str
Activity
kirk86 commentedon Feb 13, 2020
I can confirm getting kind of similar error
TjWallas commentedon Feb 27, 2020
I am also getting the same error. Any help here?
wenlibin02 commentedon Feb 28, 2020
Try the quick fix in the recent pull request: 6789a4b
kirk86 commentedon Feb 28, 2020
@wenlibin02 Does it work for you?
wenlibin02 commentedon Feb 29, 2020
Yes, after I applied the code modification in the commit previously mentioned.