[Django] #27187: Django 1.10 is unable to unpickle models pickled in Django pre-1.10

21 views
Skip to first unread message

Django

unread,
Sep 6, 2016, 12:38:20 PM9/6/16
to django-...@googlegroups.com
#27187: Django 1.10 is unable to unpickle models pickled in Django pre-1.10
-------------------------------------+-------------------------------------
Reporter: claudep | Owner: nobody
Type: Bug | Status: new
Component: Database | Version: 1.10
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Commit [7f51876f99851fdc3fef63aecdfbcffa199c26b9] changed the unpickle
strategy for models. Now when I have old pickled models (for example in a
queue) that I'm trying to unpickle with Django 1.10, I'm getting those
errors:

{{{
UnpickleError at /django-rq/queues/1/
(u'Could not unpickle', AttributeError("'module' object has no attribute
'simple_class_factory'",))
}}}
And if I manually re-introduce `simple_class_factory`, I'm then getting:
{{{
UnpickleError at /django-rq/queues/1/
(u'Could not unpickle', TypeError('model_unpickle() takes exactly 1
argument (3 given)', <function model_unpickle at 0x7f921ddc8578>,
(('accounts', 'BDNUser'), [], <function simple_class_factory at
0x7f921ddc8500>)))
}}}

Which could be solved by adding `*args` to `model_unpickle`.
What about adding some compatibility shims during one or two releases?

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

Django

unread,
Sep 6, 2016, 2:11:35 PM9/6/16
to django-...@googlegroups.com
#27187: Django 1.10 is unable to unpickle models pickled in Django pre-1.10
-------------------------------------+-------------------------------------
Reporter: claudep | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.10
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by timgraham):

The consensus from #21430 seemed to be that cross-version pickling support
wasn't something we wanted to try to do. I guess you could ask on the
mailing list whether we should revisit that.

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

Django

unread,
Sep 14, 2016, 8:59:05 PM9/14/16
to django-...@googlegroups.com
#27187: Django 1.10 is unable to unpickle models pickled in Django pre-1.10
-------------------------------------+-------------------------------------
Reporter: claudep | Owner: nobody
Type: Bug | Status: closed

Component: Database layer | Version: 1.10
(models, ORM) |
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* status: new => closed
* resolution: => needsinfo


Comment:

Closing pending discussion.

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

Django

unread,
Sep 15, 2016, 4:20:27 AM9/15/16
to django-...@googlegroups.com
#27187: Django 1.10 is unable to unpickle models pickled in Django pre-1.10
-------------------------------------+-------------------------------------
Reporter: claudep | Owner: nobody
Type: Bug | Status: closed
Component: Database layer | Version: 1.10
(models, ORM) |
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by claudep):

Sorry, I missed your first comment.
I still think that if we can take simple measures to ensure the
compatibility with only the next Django version, it would be worth it.
However my motivation is not strong enough to push this forward now.

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

Reply all
Reply to author
Forward
0 new messages