From: Grant E. <gr...@vi...> - 2007-04-18 21:15:40
|
On Wed, Apr 18, 2007 at 11:26:21AM -0500, Grant Edwards wrote: > I feel like I've spent the past 3 days beating my head against > a wall: no matter what I do, I can't get gnuplot-py to work > reliably on Win2K or WinXP. [...] > What refuses to work is when the program is started by clicking > on a file whose type has been associated with the program. In > that case, I always get an "invalid parameter" IOError when > gp_win32.py writes to the pipe in its __call__ method. The base cause of Gnuplot.py failing is that os.popen() can't be used if the CWD is a UNC network path. See the link below if you're interested in Microsoft's half-assed rationalization of this particular bit of Windows breakage: http://support.microsoft.com/kb/156276/EN-US/ The answer is to change gp_win32.py so that instead of os.popen() it uses subprocess.Popen() with shell=False. However, there are bugs in the subprocess module that you have to work-around: http://www.py2exe.org/index.cgi/Py2ExeSubprocessInteractions Using subprocess.Popen() with the above work-arounds seems to work. It also eliminates the requirement to double-quote a path that contains a string. After I've tested it a little more, I'll submit a patch. -- Grant Edwards gr...@vi... |