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

Problems related with "No JSON object could be decoded" in Python 2.7.13 #72

Closed
rubenmulero opened this issue Mar 7, 2017 · 1 comment

Comments

@rubenmulero
Copy link

Hello.

Firstly I want to say that I new with Zotero and Pyzotero so I want to know exaclty if this is my fault or not.

I'm having an error using Pyzotero when I want to retrieve information in bibtext format. If I do the following:

item = zot.item(item_key, format='bibtex')

where:

  • zot: A zotero instance

  • item_key: A key of the item that I want to recover from API.

The following error raises:

raise ValueError("No JSON object could be decoded")

I seems that error is produced when Pyzotero uses "requests" library. I think it could be my Python version (Python 2.7.13).

If I call to method without "format" the library works well. In a Ubuntu 14.04 machine (Using older version of Python 2) it works without problems.

Any ideas?

Thanks in advance.

@urschrei
Copy link
Owner

urschrei commented Mar 7, 2017

You say it works without problems on an older version of Python 2. Are you sure? Could you check both the Python version and the Pyzotero version on the older machine?

I ask because I think it's a Pyzotero problem, and it shouldn't matter what version of Python 2 you're running.

I've pushed what I hope is a fix to PyPI, so if you upgrade your current Pyzotero version (latest is 1.2.6), you should get valid BibTeX back.

urschrei added a commit that referenced this issue Nov 20, 2017
The original fix (b338e44) removed all control characters. However,
this introduced an inconsistency between the way in which Zotero[.org]
represents and exports data, and how Pyzotero presents the data. This
commit removes that inconsistency.

The fix involves the addition of python-bibtexparser, which is now
used to process bibtex entries.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants