-
Notifications
You must be signed in to change notification settings - Fork 151
De-serialized response from custom serializer does not have expected CachedResponse attributes #452
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
Comments
Thanks for reporting that. I'm not sure off the top of my head why that As for the Try installing the poetry 1.2 pre-release: curl -o install-poetry.py https://install.python-poetry.org
python install-poetry.py --version 1.2.0a2 |
@jseabold Here, try this: import gzip
from requests_cache import CachedSession, SerializerPipeline, Stage, pickle_serializer
compressed_serializer = SerializerPipeline([
pickle_serializer,
Stage(dumps=gzip.compress, loads=gzip.decompress),
])
session = CachedSession(serializer=compressed_serializer)
session.cache.clear()
session.get('http://httpbin.org/get')
session.get('http://httpbin.org/get') The difference with I was able to reproduce the error with your example, but still not quite sure why that's happening. In the mean time, I updated the pre-release docs with the working example above. |
Okay, now I remember what's going on. So I think using plain |
Fixed in pre-release build |
The problem
My CachedResponse instance does not appear to be getting default attributes that aren't on the original response like 'created_at' and 'expires' properly. It has cache_key which gets explicitly assigned.
Repro:
Environment
I've been unable to get the package to successfully build on 3.9 due to a puzzling reported setuptools import error, so I don't know if this persists in master or is somehow a local issue. Can provide anymore information as needed.
The text was updated successfully, but these errors were encountered: