Changes between Initial Version and Version 1 of Ticket #11577


Ignore:
Timestamp:
07/05/11 15:01:25 (8 years ago)
Author:
logix
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #11577

    • Property Summary changed from save(x,filename) fails for some types of objects for x if filename contains a dot to save(x,filename) fails for pure Python objects for x if filename contains a dot
  • Ticket #11577 – Description

    initial v1  
     1(The summary actually is not completely accurate - there might be some Python object this works for that I'm not aware of)
     2
    13If the filename passed to save() contains a dot, save() assumes that the user doesnt just want to dump the (pickled) object, but instead wants to call the object's save() method. I guess this makes sense in situations like save(g, 'mygraph.png'), but the code should fall back to dumping the pickled version (e.g. via try: ... except AttributeError: ... - suggested via IRC by leif) if the object has no save() method.
    24
    35leif also suggested checking if the file name extension is known - however I guess that we then should verify this with the object itself (e.g. it wouldn't make sense to save a graphics object to a .wav file) and not statically compare with a list of known extensions.
     6
    47
    58{{{