Opened 10 months ago

Last modified 10 months ago

#28223 assigned Bug

Form not always picklable due to template renderer

Reported by: Claude Paroz Owned by: Gaurav Sehgal
Component: Forms Version: 1.11
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


I'm confronted with a random pickling issue with some forms in Django 1.11.
The error is : PicklingError: Can't pickle <type 'function'>: attribute lookup __builtin__.function failed

I tracked the pickling error to the Form.renderer.engine.engine.template_libraries dict.

I can more or less reproduce (different error message, but hopefully same cause) with:

from django.forms.renderers import get_default_renderer
import pickle
renderer = get_default_renderer()

PicklingError: Can't pickle <function add_preserved_filters at 0x7f2468bfc620>: it's not the same object as django.contrib.admin.templatetags.admin_urls.add_preserved_filters

Change History (2)

comment:1 Changed 10 months ago by Tim Graham

Summary: Form not always picklableForm not always picklable due to template renderer
Triage Stage: UnreviewedAccepted

comment:2 Changed 10 months ago by Gaurav Sehgal

Owner: changed from nobody to Gaurav Sehgal
Status: newassigned
Note: See TracTickets for help on using tickets.
Back to Top