-
-
Notifications
You must be signed in to change notification settings - Fork 33.6k
Closed as not planned
Labels
3.13bugs and security fixesbugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement
Description
Bug report
Bug description:
I am developing a program that employs multiprocessing to enhance efficiency through parallel execution. Python relies on the pickle module for object serialization and inter-process communication. However, I've encountered an issue where the CookieJar object cannot be pickled due to its inclusion of an RLock object, which is causing problems in my application.
Here is the membership hierarchy:
openai.OpenAI -> httpx.Client -> httpx.Cookies -> http.cookiejar.CookieJar
Reproduce snippet:
# Add a code block here, if required
import pickle
from http.cookiejar import CookieJar
jar = CookieJar()
pickle.dumps(jar) # TypeError: cannot pickle '_thread.RLock' objectWe could implement a __reduce__ method for the CookieJar class to let it support serialization.
CPython versions tested on:
3.11
Operating systems tested on:
macOS
Linked PRs
Metadata
Metadata
Assignees
Labels
3.13bugs and security fixesbugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement
Projects
Status
Done

