Closed skvrnami closed 3 years ago
I can't reproduce this using 1.4.24: your example works perfectly across multiple tries. Can you confirm that this wasn't a transient error, and that "simple" item creation works correctly; i.e. that a created item becomes available in the web interface / client?
Hi, thanks for your time. I checked and the item creation works ok (see screenshot from the web interface). The code returns error after running the last line.
As you can see from the traceback, there's a 404 error occurring which means that the API call which attempts to create the note can't find the parent item which is being created first. Unless there's an error when creating the parent item, I don't see how this can be possible in a single-threaded program.
Are you sure that the example you posted is representative of what you're trying to do? This is the sort of problem that can occur in an async program or something using sub-processes – as I said, when I run your example program it works.
Problem Description
I was trying to create a note and attach it to an item, but the function
create_items
raises404 Client Error
. The problem is in attaching the note to the parent item as the note is successfully created in the main Zotero folder, but the attachment of note to the parent item fails.Minimal reproducible example is here:
Platform: macOS Python version: Python 3.8.2 Pyzotero version: 1.4.24
More Details
Traceback
``` Traceback (most recent call last): File "/Users/skvrnami/github/zoteroRemarkable/.env/lib/python3.8/site-packages/pyzotero/zotero.py", line 1295, in create_items presp.raise_for_status() File "/Users/skvrnami/github/zoteroRemarkable/.env/lib/python3.8/site-packages/requests/models.py", line 943, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.zotero.org/users/2422340/items/2D8VZ86W During handling of the above exception, another exception occurred: Traceback (most recent call last): File "