urschrei / pyzotero

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

Pyzotero incompatible with python 3.9 due to feedparser dependency #129

Closed danmackinlay closed 3 years ago

danmackinlay commented 3 years ago

Platform: Ubuntu Python version: 3.9.1 Pyzotero version: 1.4.18

Problem description

Error is thrown upon importing pyzotero: AttributeError: module 'base64' has no attribute 'decodestring'. This is a problem in feedparser, depending upon APIs that only work in python <3.9. This is fixed in feedparser 6. However, pyzotero pins feedparser version to <6, so pyzotero is incompatible with python 3.9.

Related #117 , #126 where the pinned dependency is discussed.

More Details

If possible, paste the full traceback in a code block below, and fill in the summary

Traceback Traceback (most recent call last): File "/home/dan/Source/livingthing/./preen_zotero.py", line 15, in from pyzotero import zotero File "/home/dan/miniconda3/envs/livingthing/lib/python3.9/site-packages/pyzotero/zotero.py", line 43, in import feedparser File "/home/dan/miniconda3/envs/livingthing/lib/python3.9/site-packages/feedparser.py", line 93, in _base64decode = getattr(base64, 'decodebytes', base64.decodestring) AttributeError: module 'base64' has no attribute 'decodestring'
urschrei commented 3 years ago

Could you clarify what version of feedparser is installed in your environment?

danmackinlay commented 3 years ago

feedparser 5.2.1 produces the mentioned error. Alternatively I can override the pyzotero dependencies and install feedparser 6.0.2; In that case I get as in #126, No attribute ‘_FeedParserMixin’

urschrei commented 3 years ago

As of v1.4.20 (released in December 2020 and available on PyPI and Anaconda), Pyzotero patches the decodestring import to ensure Feedparser 5.2.1 compatibility with Python 3.9.

danmackinlay commented 3 years ago

Ah thank you. I don't know how I have 5.1.8 then, since the environment is not that old, but you are correct: a simple upgrade fixes it.