HoloArchivists / twspace-dl

A python module to download twitter spaces.
GNU General Public License v2.0
473 stars 78 forks source link

Suggested fix for "cannot import name 'JSONDecodeError'" #77

Closed edrozenberg closed 1 year ago

edrozenberg commented 1 year ago

Describe the bug When running the cli utility version 20221209_b864626, seeing an error due to a missing py import.

To Reproduce twspace_dl

Expected behavior No error

Output

Traceback (most recent call last):
  File "/usr/bin/twspace_dl", line 5, in <module>
    from twspace_dl.__main__ import main
  File "/usr/lib64/python3.9/site-packages/twspace_dl/__init__.py", line 3, in <module>
    from .twspace import Twspace
  File "/usr/lib64/python3.9/site-packages/twspace_dl/twspace.py", line 10, in <module>
    from requests.exceptions import JSONDecodeError
ImportError: cannot import name 'JSONDecodeError' from 'requests.exceptions' (/usr/lib64/python3.9/site-packages/requests/exceptions.py)

Desktop (please complete the following information):

Additional context Possible fix:

modify twspace.py as follows:

Delete: from requests.exceptions import JSONDecodeError

Add: from json import JSONDecodeError

I don't know if this is the "right fix" but it seems to work.

Ryu1845 commented 1 year ago

Actually, I don't even use that import (it was used in an intermediate step while solving #62). I can just delete it