We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
BaseUrlSession
base_url
Pickle and unpickle a BaseUrlSession will result in an empty URL:
>>> from requests_toolbelt.sessions import BaseUrlSession >>> import pickle >>> session = BaseUrlSession(base_url="https://www.test.com") >>> with open("pickled_session.pkl", "wb") as f: ... pickle.dump(session, f) ... >>> with open("pickled_session.pkl", "rb") as f: ... s = pickle.load(f) ... >>> s.base_url >>> session.base_url 'https://www.test.com'
In requests, the attributes are handled the in:
requests
def __getstate__(self): state = {attr: getattr(self, attr, None) for attr in self.__attrs__} return state def __setstate__(self, state): for attr, value in state.items(): setattr(self, attr, value)
I think base_url should also be handled in BaseUrlSession. I can create a PR for this and ask for you review
The text was updated successfully, but these errors were encountered:
I'll review that for sure
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Pickle and unpickle a BaseUrlSession will result in an empty URL:
In
requests
, the attributes are handled the in:I think
base_url
should also be handled inBaseUrlSession
. I can create a PR for this and ask for you reviewThe text was updated successfully, but these errors were encountered: