[Django] #28223: Form not always picklable

15 views
Skip to first unread message

Django

unread,
May 19, 2017, 5:29:35 AM5/19/17
to django-...@googlegroups.com
#28223: Form not always picklable
----------------------------------------+------------------------
Reporter: Claude Paroz | Owner: nobody
Type: Bug | Status: new
Component: Forms | Version: 1.11
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
----------------------------------------+------------------------
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()
renderer.engine
pickle.dumps(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
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28223>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 19, 2017, 8:25:07 AM5/19/17
to django-...@googlegroups.com
#28223: Form not always picklable due to template renderer
------------------------------+------------------------------------

Reporter: Claude Paroz | Owner: nobody
Type: Bug | Status: new
Component: Forms | Version: 1.11
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+------------------------------------
Changes (by Tim Graham):

* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/28223#comment:1>

Django

unread,
May 23, 2017, 10:37:39 AM5/23/17
to django-...@googlegroups.com
#28223: Form not always picklable due to template renderer
------------------------------+-----------------------------------------
Reporter: Claude Paroz | Owner: Gaurav Sehgal
Type: Bug | Status: assigned
Component: Forms | Version: 1.11

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+-----------------------------------------
Changes (by Gaurav Sehgal):

* owner: nobody => Gaurav Sehgal
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/28223#comment:2>

Django

unread,
May 17, 2018, 2:44:12 AM5/17/18
to django-...@googlegroups.com
#28223: Form not always picklable due to template renderer
------------------------------+-----------------------------------------
Reporter: Claude Paroz | Owner: Gaurav Sehgal
Type: Bug | Status: assigned
Component: Forms | Version: 1.11

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+-----------------------------------------

Comment (by Carlton Gibson):

#29411 is a duplicate of this, with a slightly different reproduce case.

--
Ticket URL: <https://code.djangoproject.com/ticket/28223#comment:3>

Django

unread,
May 17, 2018, 4:17:01 AM5/17/18
to django-...@googlegroups.com
#28223: Form not always picklable due to template renderer
------------------------------+-----------------------------------------
Reporter: Claude Paroz | Owner: Gaurav Sehgal
Type: Bug | Status: assigned
Component: Forms | Version: 1.11

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+-----------------------------------------
Changes (by Torsten Bronger):

* cc: Torsten Bronger (added)


Comment:

To copy over important information from duplicate:

This broke in 1.11 and had worked in 1.10 and before.

--
Ticket URL: <https://code.djangoproject.com/ticket/28223#comment:4>

Django

unread,
Aug 28, 2018, 11:05:00 PM8/28/18
to django-...@googlegroups.com
#28223: Form not always picklable due to template renderer
------------------------------+-----------------------------------------
Reporter: Claude Paroz | Owner: Gaurav Sehgal
Type: Bug | Status: assigned
Component: Forms | Version: 1.11

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+-----------------------------------------

Comment (by za):

Is this bug related with this
https://docs.djangoproject.com/en/2.1/releases/1.11/#django-template-
backends-django-template-render-prohibits-non-dict-context ?

--
Ticket URL: <https://code.djangoproject.com/ticket/28223#comment:5>

Django

unread,
Aug 29, 2018, 8:56:05 AM8/29/18
to django-...@googlegroups.com
#28223: Form not always picklable due to template renderer
------------------------------+-----------------------------------------
Reporter: Claude Paroz | Owner: Gaurav Sehgal
Type: Bug | Status: assigned
Component: Forms | Version: 1.11

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+-----------------------------------------

Comment (by Tim Graham):

I believe template widget rendering
(b52c73008a9d67e9ddbb841872dc15cdd3d6ee01 introduced this issue.

--
Ticket URL: <https://code.djangoproject.com/ticket/28223#comment:6>

Django

unread,
Jan 24, 2019, 8:32:02 AM1/24/19
to django-...@googlegroups.com
#28223: Form not always picklable due to template renderer
------------------------------+-----------------------------------------
Reporter: Claude Paroz | Owner: Gaurav Sehgal
Type: Bug | Status: assigned
Component: Forms | Version: 1.11

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+-----------------------------------------
Changes (by Martin Honermeyer):

* cc: Martin Honermeyer (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/28223#comment:7>

Django

unread,
Aug 25, 2020, 6:28:04 AM8/25/20
to django-...@googlegroups.com
#28223: Form not always picklable due to template renderer
------------------------------+-----------------------------------------
Reporter: Claude Paroz | Owner: Gaurav Sehgal
Type: Bug | Status: assigned
Component: Forms | Version: 1.11

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+-----------------------------------------
Changes (by Matti Haavikko):

* cc: Matti Haavikko (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/28223#comment:8>

Reply all
Reply to author
Forward
0 new messages