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

Fix: except right exception #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

mukhamux
Copy link

Hi, guy! Fix little bug, when I start the code I receive exception like:

  File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py", line 1534, in _exec
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "/Users/zzz/Library/Application Support/JetBrains/PyCharm2023.3/scratches/scratch1.py", line 46, in <module>
    main()
  File "/Users/zzz/Library/Application Support/JetBrains/PyCharm2023.3/scratches/scratch1.py", line 5, in main
    df = spice.query('''
  File "/Users/zzz/work/vvv/venv/lib/python3.8/site-packages/spice/_extract.py", line 240, in query
    df = _get_results(**execute_kwargs, **result_kwargs)
  File "/Users/zzz/work/vvv/venv/lib/python3.8/site-packages/spice/_extract.py", line 921, in _get_results
    except (requests.JSONDecodeError):
AttributeError: module 'requests' has no attribute 'JSONDecodeError'

@cuamckuu
Copy link

That probably should be fixed in by setting propper version of requests library in requirements.txt

@mukhamux
Copy link
Author

mukhamux commented Dec 26, 2024

requests.JSONDecodeError appear in init in 2.27.0, we can change pyproject.toml requirement from "requests >= 2.16" to "requests >= 2.27.0"

psf/requests@db575ee#diff-b7fe12398abcd549da14e1587f58382c34740bdf590f8c79c127c4f9981b7585R142

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

Successfully merging this pull request may close these issues.

2 participants