SourceForge logo
SourceForge logo
Menu

Re: [matplotlib-devel] Little fix in the TkAgg backend

From: Michael D. <md...@st...> - 2007年11月14日 13:58:48
Thanks. This has been committed in SVN revision 4267, and will likely 
make it into the upcoming release.
Cheers,
Mike
Michael Zell wrote:
> Hi,
> 
> whenever I clicked the "save"-button in a plot in my TkAgg and pressed 
> "cancel" in the file dialog, I got the error message
> 
> Exception in Tkinter callback
> Traceback (most recent call last):
> File "lib-tk/Tkinter.py", line 1406, in __call__
> return self.func(*args)
> File 
> "/usr/lib/python2.5/site-packages/matplotlib/backends/backend_tkagg.py", 
> line 641, in save_figure
> bname, fext = os.path.splitext(fname)
> File "posixpath.py", line 92, in splitext
> i = p.rfind('.')
> AttributeError: 'tuple' object has no attribute 'rfind'
> 
> This obviously happened because tkFileDialog.asksaveasfilename returned 
> an empty tupel rather than an empty string, when the user cancels the 
> file dialog. I fixed it by replacing the line
> 
> if fname == "":
> 
> by
> 
> if fname == "" or fname == ():
> 
> in the file backend_tkagg.py.
> 
> Thank you,
> Michael Zell
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Matplotlib-devel mailing list
> Mat...@li...
> 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

View entire thread

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /