[NumPy-Tickets] [NumPy] #1897: Pickling a numpy.ma.MaskedConstant fails

NumPy Trac numpy-tickets@scipy....
Thu Jul 7 04:46:36 CDT 2011


#1897: Pickling a numpy.ma.MaskedConstant fails
----------------------+-----------------------------------------------------
 Reporter:  jpaalasm  |       Owner:  pierregm   
     Type:  defect    |      Status:  new        
 Priority:  high      |   Milestone:  Unscheduled
Component:  numpy.ma  |     Version:  1.5.1      
 Keywords:            |  
----------------------+-----------------------------------------------------
 {{{
 Python 2.7.1+ (r271:86832, Apr 11 2011, 18:13:53)
 [GCC 4.5.2] on linux2
 Type "help", "copyright", "credits" or "license" for more information.
 >>> import pickle; import numpy; numpy.__version__
 '1.5.1'
 >>> ma = numpy.ma.MaskedArray([0, 0, 0], mask=True)
 >>> m = ma[0]
 >>> m
 masked
 >>> pickle.dumps(m)
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/usr/lib/python2.7/pickle.py", line 1374, in dumps
     Pickler(file, protocol).dump(obj)
   File "/usr/lib/python2.7/pickle.py", line 224, in dump
     self.save(obj)
   File "/usr/lib/python2.7/pickle.py", line 306, in save
     rv = reduce(self.proto)
   File "/usr/lib/pymodules/python2.7/numpy/ma/core.py", line 5494, in
 __reduce__
     self.__getstate__())
   File "/usr/lib/pymodules/python2.7/numpy/ma/core.py", line 5467, in
 __getstate__
     self._fill_value,
 AttributeError: 'MaskedConstant' object has no attribute '_fill_value'
 >>>
 }}}

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/1897>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list