RedHatProductSecurity / cvelib

A Python library and command line interface for CVE Services.
MIT License
56 stars 24 forks source link

Make CveRecordValidationError picklable #62

Closed mprpic closed 1 year ago

mprpic commented 1 year ago

This prevents PicklingError errors when the exception is stored e.g. by Celery when creating TaskResult records:

{"exc_type": "MaybeEncodingError", "exc_message":
["'PicklingError(\"Can\\'t pickle <class
\\'cvelib.cve_api.CveRecordValidationError\\'>: it\\'s not the same
object as cvelib.cve_api.CveRecordValidationError\")'", "\"(1,
<ExceptionInfo: CveRecordValidationError('Schema validation against
/usr/local/lib/python3.9/site-packages/cvelib/schemas/published_cna_container_5.0.0.json
failed')>, None)\""], "exc_module": "billiard.pool"}