-
The following error gets thrown:
Tested on Python versions 3.7.12 and 3.9.10 |
Beta Was this translation helpful? Give feedback.
Answered by
Kludex
Jun 9, 2022
Replies: 2 comments 1 reply
-
This seems related:
|
Beta Was this translation helpful? Give feedback.
1 reply
-
This works if you use the import copyreg
import pickle
from starlette.exceptions import HTTPException
def pickle_http_exception(exc):
return HTTPException, (exc.status_code, exc.detail, exc.headers)
copyreg.pickle(HTTPException, pickle_http_exception)
print(pickle.loads(pickle.dumps(HTTPException(status_code=404)))) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Kludex
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This works if you use the
copyreg
module.