Skip to content

Error Raised: TypeError: list indices must be integers, not unicode #3

@wenlibin02

Description

@wenlibin02

Hello @devmessias,

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.

Thanks a lot.

Libin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions