Skip to content

pickle / celery breaks with exceptions  #139

Closed
@syphar

Description

@syphar

Issue Summary

We are using this library in a celery background task, using celery. (through the sendgrid library, and actually django-celery-email).

When errors happen with the sendgrid API (like a BAD REQUEST), celery can handle this exception and normally pickle it to return it to the caller.

Currently we are seeing a PicklingError where the exception type from this library can be pickled.

As seen in this issue the problem is that in the custom exception types super() is not called.

Exception/Log

line breaks added for readability

ERROR [none] celery.worker.request: 
Task handler raised error: <MaybeEncodingError: Error sending result: 
''(1, <ExceptionInfo: BadRequestsError("<HTTPError 400: \'Bad Request\'>",)>, None)''. 
Reason: ''PicklingError("Can\'t pickle 
<class \'python_http_client.exceptions.BadRequestsError\'>: it\'s not 
the same object as python_http_client.exceptions.BadRequestsError",)''.>

Technical details:

  • python-http-client version: 3.2.1
  • python version: 3.6.10

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions