#10353: Remove zodb from sage
-----------------------------------+----------------------------------------
Reporter: was | Owner: jason
Type: defect | Status: needs_review
Priority: major | Milestone: sage-5.6
Component: misc | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers:
Authors: François Bissey | Merged in:
Dependencies: 12205 | Stopgaps:
-----------------------------------+----------------------------------------
Changes (by {'newvalue': u'Fran\xe7ois Bissey', 'oldvalue': ''}):
* status: new => needs_review
* dependencies: => 12205
* author: => François Bissey
Old description:
> {{{
> wstein@sage:~$ /usr/local/bin/sage
> ----------------------------------------------------------------------
> | Sage Version 4.6, Release Date: 2010-10-30 |
> | Type notebook() for the GUI, and license() for information. |
> ----------------------------------------------------------------------
> sage: d = sage.databases.db.Database('sage_zodb', read_only=False)
> sage: d[12] = factor(12)
> sage: d.commit()
> ...
> TypeError: can't pickle SageObject objects
> }}}
>
> There is a zodb mailing list discussion related to the pickle protocol
> here: http://www.mail-archive.com/[email protected]/msg04628.html
>
> In particular, pickle protocol 1 is hardcoded. But SageObjects/Cython
> objects must use protocol 2 in many cases:
> {{{
> sage: import cPickle
> sage: F = factor(12)
> sage: cPickle.dumps(F, protocol=0)
> TypeError: can't pickle SageObject objects
> sage: cPickle.dumps(F, protocol=1)
> TypeError: can't pickle SageObject objects
> sage: cPickle.dumps(F, protocol=2)
> '\x80\x02csage.structure.factorization\nFactorization\nq\x01)\x81q\x02}q\x03(U\x12_Factorization__crq\x04\x89U\x14_Factorization__unitq\x05csage.rings.integer\nmake_integer\nq\x06U\x011\x85Rq\x07U\x18_Factorization__universeq\x08csage.rings.integer_ring\nIntegerRing\nq\t)Rq\nU\x11_Factorization__xq\x0b]q\x0c(h\x06U\x012\x85Rq\rK\x02\x86q\x0eh\x06U\x013\x85Rq\x0fK\x01\x86q\x10eub.'
> }}}
>
> There is some code in Sage that uses ZODB (e.g, Cremona database), but I
> think it uses only pure python objects, so the above isn't a problem.
>
> See also the related ticket #10352.
>
> Some ideas for how to fix this:
>
> - Modify ZODB itself, e.g., by changing: ZODB.serialiize.ObjectWriter
> as suggested here: http://www.mail-archive.com/zodb-
> [email protected]/msg04766.html
>
> - Figure out how to monkeypatch ODB.serialiize.ObjectWriter at runtime,
> then document this hack
>
> - "Fix" SageObject and/or Cython, so Sage objects can serialize using
> Pickle protocol 1 instead of requiring 2. I don't personally understand
> exactly why SageObject can't be pickled using protocol 1.
New description:
zodb only use the pickle protocol version 1. It is also not used in sage
apart from one package that has been migrated away from it in #12205.
There is a zodb mailing list discussion related to the pickle protocol
here: http://www.mail-archive.com/[email protected]/msg04628.html
In particular, pickle protocol 1 is hardcoded. But SageObjects/Cython
objects must use protocol 2 in many cases:
{{{
sage: import cPickle
sage: F = factor(12)
sage: cPickle.dumps(F, protocol=0)
TypeError: can't pickle SageObject objects
sage: cPickle.dumps(F, protocol=1)
TypeError: can't pickle SageObject objects
sage: cPickle.dumps(F, protocol=2)
'\x80\x02csage.structure.factorization\nFactorization\nq\x01)\x81q\x02}q\x03(U\x12_Factorization__crq\x04\x89U\x14_Factorization__unitq\x05csage.rings.integer\nmake_integer\nq\x06U\x011\x85Rq\x07U\x18_Factorization__universeq\x08csage.rings.integer_ring\nIntegerRing\nq\t)Rq\nU\x11_Factorization__xq\x0b]q\x0c(h\x06U\x012\x85Rq\rK\x02\x86q\x0eh\x06U\x013\x85Rq\x0fK\x01\x86q\x10eub.'
}}}
See also the related ticket #10352.
The suggested option for this ticket is to remove zodb from sage.
----
* Apply [attachment:trac10353-db-removal.patch] to the sage library
* Apply [attachment:trac10353-sage_root.patch] to the sage root repository
--
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10353#comment:10>
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 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/sage-trac?hl=en.