#28389: pickling LazyObject works incorrectly on Python 2
-------------------------------------------+------------------------
               Reporter:  Sergey Fedoseev  |          Owner:  nobody
                   Type:  Bug              |         Status:  new
              Component:  Utilities        |        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                |
-------------------------------------------+------------------------
 {{{
 In [126]: import pickle
 In [127]: from django.utils.functional import LazyObject
 In [128]: class A(object):
      ...:     pass
      ...:
 In [129]: lazy_obj = LazyObject()
 In [130]: a = A()
 In [131]: a.foo = 'bar'
 In [132]: lazy_obj._wrapped = a
 In [133]: pickle.loads(pickle.dumps(lazy_obj)).foo
 ---------------------------------------------------------------------------
 AttributeError                            Traceback (most recent call
 last)
 <ipython-input-133-a85d49df8170> in <module>()
 ----> 1 pickle.loads(pickle.dumps(lazy_obj)).foo

 AttributeError: 'A' object has no attribute 'foo'
 }}}

 Introduced in 35355a4ffedb2aeed52d5fe3034380ffc6a438db.

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/053.2c9eb8d4402176132991f9602453c36f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to