#16275: Hom: introduce a check argument to simplify the unpickling detection
logic
-------------------------------------+-------------------------------------
Reporter: nthiery | Owner:
Type: enhancement | Status: new
Priority: major | Milestone: sage-6.2
Component: categories | Resolution:
Keywords: homset, pickling | Merged in:
Authors: Nicolas M. ThiƩry | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/nthiery/hom__introduce_a_check_argument_to_simplify_the_unpickling_detection_logic|
ae3ca8080a8412891722695d1e24e1dfe374d787
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by SimonKing):
Even stranger, I see the following:
{{{
sage: t = load("/home/king/Downloads/broken_pickle.sobj")
have error message <class
'sage.modular.modsym.ambient.ModularSymbolsAmbient_wt2_g0_with_category'>
instance is not in Category of Hecke modules over Rational Field
---------------------------------------------------------------------------
ValueError Traceback (most recent call
last)
<ipython-input-1-540ff1d7475d> in <module>()
----> 1 t = load("/home/king/Downloads/broken_pickle.sobj")
/home/king/Sage/git/sage/local/lib/python2.7/site-
packages/sage/structure/sage_object.so in sage.structure.sage_object.load
(sage/structure/sage_object.c:9774)()
/home/king/Sage/git/sage/local/lib/python2.7/site-
packages/sage/structure/sage_object.so in sage.structure.sage_object.loads
(sage/structure/sage_object.c:11522)()
/home/king/Sage/git/sage/local/lib/python2.7/site-
packages/sage/categories/homset.pyc in Hom(X, Y, category, check)
387 error_msg = "{} instance is not in
{}".format(type(O), category)
388 print "have error message",error_msg
--> 389 raise ValueError(error_msg)
390
391 # Construct H
<type 'str'>: (<type 'exceptions.AttributeError'>,
AttributeError('ModularSymbolsAmbient_wt2_g0_with_category' object has no
attribute '_HeckeModule_generic__level',))
}}}
I think a `ValueError` should be raised, not a `TypeError`. Anyway, a
`ValueError` is raised, with a sufficiently nice error message, but a
totally different error is shown to the user!
Bug in ipython??
--
Ticket URL: <http://trac.sagemath.org/ticket/16275#comment:14>
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.