urschrei / pyzotero

Pyzotero: a Python client for the Zotero API
https://pyzotero.readthedocs.org
Other
899 stars 98 forks source link

Using create_items to create a linked_url or linked_file attachment item will cause AttributeError. #112

Closed xwzliang closed 4 years ago

xwzliang commented 4 years ago

General

Platform: macOS Mojave Python version: 3.7 Pyzotero version: 1.4.14

Problem description

Using create_items to create a linked_url or linked_file attachment item will cause AttributeError.

Code: linked_url_template = zot.item_template('attachment', 'linked_url') linked_url_template['title'] = "Amazon.com Link" linked_url_template['url'] = linked_url resp = zot.create_items([linked_url_template], item_key)

Traceback: File "/usr/local/lib/python3.7/site-packages/pyzotero/zotero.py", line 1292, in create_items
backoff = presp.get("backoff")
AttributeError: 'Response' object has no attribute 'get'

urschrei commented 4 years ago

Argh. Fixed and released to PyPI. Sorry!

xwzliang commented 4 years ago

Thanks!