Issue 1176: pickle bug in protocol 2
http://code.google.com/p/sympy/issues/detail?id=1176
New issue report by ondrej.certik:
In [1]: import pickle
In [2]: pickle.loads(pickle.dumps(sin(4)))
Out[2]: sin(4)
In [3]: pickle.loads(pickle.dumps(sin(4), 2))
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (172, 0))
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/home/ondra/repos/sympy/<ipython console> in <module>()
/usr/lib/python2.5/pickle.pyc in loads(str)
1372 def loads(str):
1373 file = StringIO(str)
-> 1374 return Unpickler(file).load()
1375
1376 # Doctest
/usr/lib/python2.5/pickle.pyc in load(self)
856 while 1:
857 key = read(1)
--> 858 dispatch[key](self)
859 except _Stop, stopinst:
860 return stopinst.value
/usr/lib/python2.5/pickle.pyc in load_newobj(self)
1081 args = self.stack.pop()
1082 cls = self.stack[-1]
-> 1083 obj = cls.__new__(cls, *args)
1084 self.stack[-1] = obj
1085 dispatch[NEWOBJ] = load_newobj
/home/ondra/repos/sympy/sympy/core/multidimensional.pyc in wrapper(*args,
**kwargs)
125 result = apply_on_element(wrapper, args,
kwargs, n)
126 return result
--> 127 return f(*args, **kwargs)
128 wrapper.__doc__ = f.__doc__
129 wrapper.__name__ = f.__name__
/home/ondra/repos/sympy/sympy/core/cache.pyc in wrapper(*args, **kw_args)
83 except KeyError:
84 pass
---> 85 func_cache_it_cache[k] = r = func(*args, **kw_args)
86 return r
87
/home/ondra/repos/sympy/sympy/core/function.pyc in __new__(cls, *args,
**options)
131 if options.get('evaluate') is False:
132 return Basic.__new__(cls, *args, **options)
--> 133 r = cls.canonize(*args)
134 if isinstance(r, Basic):
135 return r
TypeError: canonize() takes exactly 2 arguments (1 given)
This prevents sympy to be working with ipython parallel stuff, so it needs
to be fixed. It also looks like a python bug, since if it works with
protocol 1, it should work with protocol 2 as well.
Issue attributes:
Status: Accepted
Owner: ----
Labels: Type-Defect Priority-High
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sympy-issues" 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/sympy-issues?hl=en
-~----------~----~----~----~------~----~------~--~---