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

Handle pickle in BaseUrlSession for base_url #376

Merged

Conversation

Inokinoki
Copy link
Contributor

@Inokinoki Inokinoki commented Mar 25, 2024

  • Add base_url when __getstate__ is called
  • Try to take base_url when __setstate__ is called

Resolve #375

- Add `base_url` when `__getstate__` is called
- Try to take `base_url` when `__setstate__` is called
Copy link
Collaborator

@sigmavirus24 sigmavirus24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add something to the change log too?

@Inokinoki
Copy link
Contributor Author

Can you add something to the change log too?

Should I put in 1.0.0 section?

@sigmavirus24
Copy link
Collaborator

Nope. Create a 1.1.0 section. 1.0 was already released

HISTORY.rst Outdated Show resolved Hide resolved
HISTORY.rst Outdated Show resolved Hide resolved
@sigmavirus24
Copy link
Collaborator

Can you look into the test failures? I don't see them in main

@Inokinoki
Copy link
Contributor Author

Can you look into the test failures? I don't see them in main

Done, but it's quite weird that two of the content length of the recorded data are wrong:

For example, httpbin:

'{\n  "args": {}, \n  "headers": {\n    "Accept": "*/*", \n    "Accept-Encoding": "gzip, deflate", \n    "Host": "httpbin.org", \n    "User-Agent": "python-requests/2.8.1"\n  }, \n  "origin": "<IPADDR>", \n  "url": "https://httpbin.org/get"\n}\n'
>>> len(_)
233

@sigmavirus24
Copy link
Collaborator

Things failing on 3.12 are failing on a deprecation warning that needs to be fixed elsewhere.

Thanks for working through this!

@sigmavirus24 sigmavirus24 merged commit 46f38f8 into requests:master Apr 9, 2024
14 of 17 checks passed
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.

Pickling and unpickling BaseUrlSession will loose base_url
2 participants