gnuplotlib
gnuplotlib copied to clipboard
Made pipe closure fail more gracefully
I had some issues running gunplotlib in my terminal interface, the pipe would try to close, fail, and kick me back to bash with an error message.
This fixes the issue. Perhaps if there's a verbose debugging option we could allow bypassing the error altogether?
On May 24, 2016 5:12:25 AM PDT, Will [email protected] wrote:
I had some issues running gunplotlib in my terminal interface, the pipe would try to close, fail, and kick me back to bash with an error message.
This fixes the issue. Perhaps if there's a verbose debuggin option we could allow bypassing the error altogether?
Hi. Thank you very much for the report. You are the first confirmed (attempted) user of gnuplotlib that isn't me, so thanks! Before applying the patch, I'd like to understand the cause a bit more. Can you tell me when you experience the issue? Always? What is your OS? Gnuplot version?
Dima
Hi Dima,
Glad to help, your interface is exactly what I was looking for. I'm running machine learning on a linux server, with only console access, and I'm using your lib for simple training set confirmation charts.
The issue occurs in two places:
- When I leave the module from which gnuplotlib was included
- When closing the application
I'm using the latest GnuPlot 5.0.3, python 2.7.3, and keep my modules up to date.
The error message I'm getting is as follows:
Exception AttributeError: AttributeError("'NoneType' object has no attribute 'waitpid'",) in <bound method gnuplotlib.__del__ of <gnuplotlib.gnuplotlib instance at 0x4b9b290>> ignored
The try, except clause fixes this issue for me on all counts, although I've left out the failure message on my machine.
I don't want to simply ignore this error. I want to figure out why it's failing, and fix it. You're saying you only have console access. This means you don't have X available? Does gnuplot work outside of gnuplotlib, or you haven't attempted it? If you execute simply "gnuplot", you should get an 'about' message and a command prompt. Above the prompt, it should say something like
terminal type set to xxx
What is xxx in your case?
Thanks!
G N U P L O T
Version 5.0 patchlevel 3 last modified 2016-02-21
Copyright (C) 1986-1993, 1998, 2004, 2007-2016
Thomas Williams, Colin Kelley and many others
gnuplot home: http://www.gnuplot.info
faq, bugs, etc: type "help FAQ"
imediate help: type "help" (plot window: hit 'h')
Terminal type set to 'unknown'
While I agree that fixing the error is better than ignoring it, graceful failure is more important than fixing all errors. Errors will always exist, it's better to catch them than to allow the operating system to do so.