[NumPy-Tickets] [NumPy] #1658: arrays with 0-length unicode strings does not unpickle well
NumPy Trac
numpy-tickets@scipy....
Tue Nov 2 07:42:11 CDT 2010
#1658: arrays with 0-length unicode strings does not unpickle well
--------------------+-------------------------------------------------------
Reporter: faltet | Owner: somebody
Type: defect | Status: new
Priority: normal | Milestone: Unscheduled
Component: Other | Version: 1.5.0
Keywords: |
--------------------+-------------------------------------------------------
This reproduces the problem:
{{{
>>> pickle.loads(pickle.dumps(np.array(u'a'))) # 1-length works well
array(u'a',
dtype='<U1')
>>> pickle.loads(pickle.dumps(np.array(u''))) # 0-length does not work
---------------------------------------------------------------------------
TypeError Traceback (most recent call
last)
/tmp/tables-2.2/<ipython console> in <module>()
/usr/local/lib/python2.6/pickle.pyc in loads(str)
1372 def loads(str):
1373 file = StringIO(str)
-> 1374 return Unpickler(file).load()
1375
1376 # Doctest
/usr/local/lib/python2.6/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/local/lib/python2.6/pickle.pyc in load_reduce(self)
1131 args = stack.pop()
1132 func = stack[-1]
-> 1133 value = func(*args)
1134 stack[-1] = value
1135 dispatch[REDUCE] = load_reduce
TypeError: data type not understood
}}}
--
Ticket URL: <http://projects.scipy.org/numpy/ticket/1658>
NumPy <http://projects.scipy.org/numpy>
My example project
More information about the NumPy-Tickets
mailing list