#15156: Pickling with __reduce__() loops creates invalid pickles
-------------------------------------+-------------------------------------
Reporter: vbraun | Owner:
Type: defect | Status: needs_info
Priority: major | Milestone: sage-6.3
Component: misc | Resolution:
Keywords: | Merged in:
Authors: SimonKing, | Reviewers:
jkeitel, novoselt, nbruin | Work issues:
Report Upstream: N/A | Commit:
Branch: | 82ba456b8c828700d28ac36822b300f00d8b1308
u/saraedum/ticket/15156 | Stopgaps:
Dependencies: #15692 |
-------------------------------------+-------------------------------------
Comment (by saraedum):
Replying to [comment:19 nbruin]:
> Replying to [comment:18 saraedum]:
> That is indeed puzzling. Would python `pickle` be unnecessarily strict
compared to `cPickle`? It seems to me that `cPickle` produces a perfectly
workable pickle from this:
> [...]
> Also for your earlier example, it looks like the pickle produced by
dumps should be just fine:
> [...]
> Well -- it does not work in the sense that `pickle.dumps` raises an
AssertionError. Since that defaults to protocol 0, while sage has already
settled on protocol 2, it's not an entirely fair test. However, specifying
`protocol=2` doesn't help, so it's really a problem in pickle and possibly
also in cPickle. However, the code produced by `explain_pickle` seems sane
and that is directly interpreted from the produced pickle, so it could
well be that cPickle does perform as we hope.
Thanks for pointing this out. I just assumed that the AssertionError was
pointing at an invalid pickle but you are right, my example actually works
with cPickle. I'll see if this explains the errors I've seen while working
on this ticket.
--
Ticket URL: <http://trac.sagemath.org/ticket/15156#comment:20>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" 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].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.