Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#26212 closed Bug (fixed)

Forms' FileField is not pickleable

Reported by: Alexey Kotlyarov Owned by: nobody
Component: Forms Version: 1.9
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In Django 1.6 through to 1.9 and current HEAD, FileField cannot be pickled though other form fields can.

Steps to reproduce:

import pickle
from django import forms
pickle.dumps(forms.FileField())

On 1.5.x, this succeeds, but 1.6 through to 1.9 fail:

PicklingError: Can't pickle <function <lambda> at 0x7faab4f2cde8>: it's not found as django.utils.translation.<lambda>

See #17976 for a similar problem with BooleanField.

Change History (7)

comment:1 Changed 4 years ago by Alexey Kotlyarov

comment:2 Changed 4 years ago by Tim Graham

Has patch: set
Patch needs improvement: set
Triage Stage: UnreviewedAccepted

Please uncheck "Patch needs improvement" when adding the test as requested on the pull request.

comment:3 Changed 4 years ago by Alexey Kotlyarov

Patch needs improvement: unset

comment:4 Changed 4 years ago by Tim Graham

Triage Stage: AcceptedReady for checkin

I'll add some release notes if we decide to backport this.

comment:5 Changed 4 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: newclosed

In b59f963:

Fixed #26212 -- Made forms.FileField and translation.lazy_number() picklable.

comment:6 Changed 4 years ago by Tim Graham <timograham@…>

In 765e6c4:

[1.9.x] Fixed #26212 -- Made forms.FileField and translation.lazy_number() picklable.

Backport of b59f963ad2a49322725b20fac71661bd49643443 from master

comment:7 Changed 4 years ago by Tim Graham <timograham@…>

In 180d4cb:

[1.8.x] Fixed #26212 -- Made forms.FileField and translation.lazy_number() picklable.

Backport of b59f963ad2a49322725b20fac71661bd49643443 from master

Note: See TracTickets for help on using tickets.
Back to Top