#10962: Set_PythonType objects are not picklable
-------------------------------------+-------------------------------------
       Reporter:  stumpc5            |        Owner:  was
           Type:  defect             |       Status:  needs_review
       Priority:  major              |    Milestone:
      Component:  pickling           |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Vincent Delecroix  |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/jdemeyer/ticket/10962            |  2908e5797bb558895695abd5443ad718cc14d5fb
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------
Changes (by jdemeyer):

 * commit:  97f39849ff27767c6a99608d3a29db9b5738ae01 =>
     2908e5797bb558895695abd5443ad718cc14d5fb


Comment:

 I confirm the unpickling error, it is due to
 {{{
 TypeError                                 Traceback (most recent call
 last)
 <ipython-input-3-d62ad2672fb4> in <module>()
 ----> 1
 
load('/home/jdemeyer/.sage/temp/tamiyo/6215/dir_LJVs2X//pickle_jar/_class__sage_groups_matrix_gps_matrix_group_element_MatrixGroupElement__.sobj')

 /usr/local/src/sage-config/src/sage/structure/sage_object.pyx in
 sage.structure.sage_object.load
 (build/cythonized/sage/structure/sage_object.c:11233)()
     945
     946     ## Load file by absolute filename
 --> 947     X = loads(open(filename).read(), compress=compress)
     948     try:
     949         X._default_filename = os.path.abspath(filename)

 /usr/local/src/sage-config/src/sage/structure/sage_object.pyx in
 sage.structure.sage_object.loads
 (build/cythonized/sage/structure/sage_object.c:13238)()
    1319     unpickler.find_global = unpickle_global
    1320
 -> 1321     return unpickler.load()
    1322
    1323

 /usr/local/src/sage-config/local/lib/python2.7/site-
 packages/sage/groups/matrix_gps/pickling_overrides.pyc in
 __setstate__(self, state)
      36         degree = state['_MatrixGroup_gap__n']
      37         from sage.libs.all import libgap
 ---> 38         libgap_group = libgap.Group(libgap(matrix_gens))
      39         self.__init__(degree, ring, libgap_group)
      40

 /usr/local/src/sage-config/src/sage/structure/parent.pyx in
 sage.structure.parent.Parent.__call__
 (build/cythonized/sage/structure/parent.c:9585)()
    1102             mor = <map.Map> self._convert_from_hash.get(R)
    1103         except KeyError:
 -> 1104             mor = <map.Map> self._internal_convert_map_from(R)
    1105
    1106         if mor is not None:

 /usr/local/src/sage-config/src/sage/structure/parent.pyx in
 sage.structure.parent.Parent._internal_convert_map_from
 (build/cythonized/sage/structure/parent.c:19460)()
    2581             return self._convert_from_hash.get(S)
    2582         except KeyError:
 -> 2583             mor = self.discover_convert_map_from(S)
    2584             # Before trac #14711, the morphism has been
    2585             # put both into _convert_from_list and into

 /usr/local/src/sage-config/src/sage/structure/parent.pyx in
 sage.structure.parent.Parent.discover_convert_map_from
 (build/cythonized/sage/structure/parent.c:20064)()
    2624             from sage.structure.coerce_maps import ListMorphism
    2625             if isinstance(S, Sequences):
 -> 2626                 return ListMorphism(S,
 self.convert_map_from(list))
    2627
    2628         mor = self._generic_convert_map(S)

 /usr/local/src/sage-config/src/sage/structure/coerce_maps.pyx in
 sage.structure.coerce_maps.ListMorphism.__init__
 (build/cythonized/sage/structure/coerce_maps.c:8911)()
     529     def __init__(self, domain, Map real_morphism):
     530         if not PY_TYPE_CHECK(domain, Parent):
 --> 531             domain = Set_PythonType(domain)
     532         Map.__init__(self, domain, real_morphism.codomain())
     533         self._coerce_cost = real_morphism._coerce_cost + 3

 /usr/local/src/sage-config/src/sage/structure/parent.pyx in
 sage.structure.parent.Set_PythonType
 (build/cythonized/sage/structure/parent.c:24290)()
    2990 cdef _type_set_cache = {}
    2991
 -> 2992 cpdef Parent Set_PythonType(theType):
    2993     """
    2994     Return the (unique) Parent that represents the set of Python
 objects

 /usr/local/src/sage-config/src/sage/structure/parent.pyx in
 sage.structure.parent.Set_PythonType
 (build/cythonized/sage/structure/parent.c:24199)()
    3021         return _type_set_cache[theType]
    3022     except KeyError:
 -> 3023         _type_set_cache[theType] = theSet =
 Set_PythonType_class(theType)
    3024         return theSet
    3025

 /usr/local/src/sage-config/src/sage/structure/parent.pyx in
 sage.structure.parent.Set_PythonType_class.__init__
 (build/cythonized/sage/structure/parent.c:24417)()
    3055         """
    3056         if not isinstance(theType, type):
 -> 3057             raise TypeError("must be intialized with a type, not
 %r" % theType)
    3058         Set_generic.__init__(self, element_constructor=theType,
 category=Sets())
    3059         self._type = theType

 TypeError: must be intialized with a type, not Category of sequences in
 Full MatrixSpace of 2 by 2 dense matrices over Finite Field of size 3
 }}}
 ----
 New commits:
 
||[http://git.sagemath.org/sage.git/commit/?id=2908e5797bb558895695abd5443ad718cc14d5fb
 2908e57]||{{{Remove useless C/API calls}}}||

--
Ticket URL: <http://trac.sagemath.org/ticket/10962#comment:12>
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.

Reply via email to