Skip to content

Conversation

@untitaker
Copy link
Member

@untitaker untitaker commented May 20, 2020

We are encountering a bug where we read double-pickled values for
project options. We suspect that during a deploy, django-picklefield
catches a SystemExit or KeyboardInterrupt here:
https://github.com/gintas/django-picklefield/blob/v1.0.0/src/picklefield/fields.py#L124

# v1.0.0 with one change: We re-raise any baseexceptions such as
# signals. 1.0.0 has a bare `except:` which causes issues.

if value is not None:
Copy link
Contributor

Choose a reason for hiding this comment

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

Quite honestly I would always reraise. If depickling fails, why would I ever want the raw value to be returned?

Copy link
Member Author

Choose a reason for hiding this comment

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

i thought this method had to be idempotent because of django?

Copy link
Contributor

Choose a reason for hiding this comment

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

Apparently this is expected to be idempotent. Let's try it like this first.

# v1.0.0 with one change: We re-raise any baseexceptions such as
# signals. 1.0.0 has a bare `except:` which causes issues.

if value is not None:
Copy link
Contributor

Choose a reason for hiding this comment

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

Apparently this is expected to be idempotent. Let's try it like this first.

@untitaker untitaker merged commit b6cddd6 into master May 20, 2020
@untitaker untitaker deleted the fix/django-picklefield-bare-except branch May 20, 2020 11:58
@github-actions github-actions bot locked and limited conversation to collaborators Dec 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants