Opened 8 years ago

Closed 8 years ago

Last modified 8 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 by Alexey Kotlyarov, 8 years ago

comment:2 by Tim Graham, 8 years ago

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 by Alexey Kotlyarov, 8 years ago

Patch needs improvement: unset

comment:4 by Tim Graham, 8 years ago

Triage Stage: AcceptedReady for checkin

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

comment:5 by Tim Graham <timograham@…>, 8 years ago

Resolution: fixed
Status: newclosed

In b59f963:

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

comment:6 by Tim Graham <timograham@…>, 8 years ago

In 765e6c4:

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

Backport of b59f963ad2a49322725b20fac71661bd49643443 from master

comment:7 by Tim Graham <timograham@…>, 8 years ago

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