#16563: Error pickling request.user
-------------------------------------+-------------------------------------
               Reporter:             |          Owner:  nobody
  zero.fuxor@…                       |         Status:  reopened
                   Type:  Bug        |      Component:  contrib.auth
              Milestone:  1.4        |       Severity:  Release blocker
                Version:  1.3        |       Keywords:
             Resolution:             |      Has patch:  0
           Triage Stage:  Design     |    Needs tests:  0
  decision needed                    |  Easy pickings:  0
    Needs documentation:  0          |
Patch needs improvement:  0          |
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
Description changed by jezdez:

Old description:

> trying to pickle a request.user in trunk raises: TypeError, can't pickle
> function objects
> Looking it shows that request.user is a SimpleLazyObject and it is a
> <lambda>, so it can not be pickled.
>

> try:
>     import cPickle as pickle
> except:
>     import pickle
>

> def some_view(request):
>     pickle.dumps(request.user) # raise type error
>     ...

New description:

 trying to pickle a request.user in trunk raises: TypeError, can't pickle
 function objects
 Looking it shows that request.user is a SimpleLazyObject and it is a
 <lambda>, so it can not be pickled.

 {{{
 try:
     import cPickle as pickle
 except:
     import pickle


 def some_view(request):
     pickle.dumps(request.user) # raise type error
     …
 }}}

--

-- 
Ticket URL: <https://code.djangoproject.com/ticket/16563#comment:4>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to