[ python-Bugs-1693079 ] Can't save empty array in shelve

SourceForge.net noreply at sourceforge.net
Mon Apr 2 18:19:37 CEST 2007


Bugs item #1693079, was opened at 2007-04-02 18:19
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1693079&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: IWL (iwl)
Assigned to: Nobody/Anonymous (nobody)
Summary: Can't save empty array in shelve

Initial Comment:

iwl wrote: 
> I've tryed to save some data containing empty arrays (array('f')) in a 
> shelve. 
> It looks like the shelve has some problems with empty arrays, get 
> allways: 
> TypeError: ("'NoneType' object is not iterable", <type 'array.array'>, 
> ('f', None))- 
> Messages when dealing with the readed back shelve. 
> Seems like I have to avoid empty arrays in a shelve. 


That seems to be a bug in the underlying pickling mechanism: 


>>> from array import array 
>>> from cPickle import loads, dumps 
>>> loads(dumps(array("f", [1]))) 
array('f', [1.0]) 
>>> loads(dumps(array("f"))) 


Traceback (most recent call last): 
  File "<stdin>", line 1, in <module> 
TypeError: ("'NoneType' object is not iterable", <type 'array.array'>, ('f', 
None)) 

Please submit a bug report. 


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1693079&group_id=5470


More information about the Python-bugs-list mailing list