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 working with newer requests-cache versions #97

Merged
merged 1 commit into from
Sep 3, 2021
Merged

fix working with newer requests-cache versions #97

merged 1 commit into from
Sep 3, 2021

Conversation

vapier
Copy link
Contributor

@vapier vapier commented Sep 1, 2021

Just inline the simple internal symbols that were being imported
from requests-cache (since it no longer exports them).

Fixes #94.

Just inline the simple internal symbols that were being imported
from requests-cache (since it no longer exports them).

Fixes #94.
@dbr dbr merged commit f8db8e9 into dbr:master Sep 3, 2021
@dbr
Copy link
Owner

dbr commented Sep 3, 2021

Thanks for this! Merged, and shall try and get this into a tagged release as soon as possible

@PumpkinCheshire
Copy link

Sorry I think the error still exist:

ImportError: cannot import name '_to_bytes' from 'requests_cache.backends.base' (/usr/lib/python3.9/site-packages/requests_cache/backends/base.py)

@almightiest
Copy link

almightiest commented May 25, 2022

I was running into this issue with python 3.8 and tvdb-api 3.1.0 with requests-cache 0.9.4.

I didn't realize 3.1.0 doesn't have the change. Looks like a new version still needs to be released, my bad on missing that.

Workaround: I was able to clone the repo, and just do a pip install -U . from the local folder to upgrade, which lets me keep the newer requests-cache version.

pip install -U requests-cache
...
tvdb-api 3.1.0 requires requests-cache<0.6.0, but you have requests-cache 0.9.4 which is incompatible.

invoking tvdb_api throws:

Traceback (most recent call last):
  File "/usr/local/bin/thetvdb.py", line 28, in <module>
    import tvdb_api
  File "/home/bleh/.local/lib/python3.8/site-packages/tvdb_api.py", line 34, in <module>
    from requests_cache.backends.base import _to_bytes, _DEFAULT_HEADERS
ImportError: cannot import name '_to_bytes' from 'requests_cache.backends.base' (/home/bleh/.local/lib/python3.8/site-packages/requests_cache/backends/base.py)

dbr added a commit that referenced this pull request Oct 4, 2022
@frank42hh
Copy link

Hmmm, after reading more issues here, I assume that the patch
637b2d2
never got it into the release, since 3.1.0 still tries to import _to_bytes from requests-cache.

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.

Replace _to_bytes usages
5 participants