Thanks for the report. As far as I can tell, this has been broken for a long time, at least since r3798 (September 2007). I just hacked at this and arrived at the same conclusion John did.
I have an interesting finding about consistency. For the use case you describe, on my machine at least Gtk, Wx and Tk don't add any extension, whereas Qt and Qt4 implicitly add an extension. In all cases, the matplotlib backend isn't doing anything to the filename -- it's just using the filename handed back from the file dialog. All of this is reasonable, unlike the problem in Fernando's original bug report. I suspect the differences are probably based on differences in HIGs. This wxWidgets bug suggests that not implicitly adding an extension is correct behavior for Gtk+. http://trac.wxwidgets.org/ticket/9917 Is it worth making this consistent between backends, or is it more important for each of the toolkits to feel native in their respective worlds. I'm leaning toward the latter -- mainly because it's less work ;) These are my versions. I wonder if different toolkit versions may also have different behavior in this regard. wxPython: 2.8.6.1 Gtk+: gtk+: 2.10.9, glib: 2.16.1, pygtk: 2.10.4, pygobject: 2.13.1 Qt: Qt: 3.3.3, PyQt: 3.17.2 Qt4: Qt: 4.3.0, PyQt4: 4.2 Cheers, Mike Fernando Perez wrote: > Howdy. This is using Tk, svn build from just now: > > In [4]: plot([1,2]) > Out[4]: [<matplotlib.lines.Line2D object at 0x31262d0>] > > In [5]: savefig('foo') > > # Then, click on the 'save' icon in the figure window, and simply type > 'foo2' in the dialog. Result: > > In [6]: d foo* > -rw-r--r-- 1 fperez 35100 2009-04-15 10:02 foo2png.png > -rw-r--r-- 1 fperez 35100 2009-04-15 10:02 foo.png > > > The dialog, instead of adding '.png', is adding 'png.png' to the > filename. I'm pretty sure this used to work fine a while ago. > > I don't know if the problem exists with all the backends. Wx at least > seems to manually add the .png extension in the right place... > > Cheers, > > f > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > High Quality Requirements in a Collaborative Environment. > Download a free trial of Rational Requirements Composer Now! > http://p.sf.net/sfu/www-ibm-com > _______________________________________________ > Matplotlib-devel mailing list > Matplotlib-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA ------------------------------------------------------------------------------ This SF.net email is sponsored by: High Quality Requirements in a Collaborative Environment. Download a free trial of Rational Requirements Composer Now! http://p.sf.net/sfu/www-ibm-com _______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel