Summary: | OpenEV Startup Error - gnuplot and paths with spaces | ||
---|---|---|---|
Product: | FWTools | Reporter: | Frank Warmerdam <warmerdam@pobox.com> |
Component: | FWTools (win32) | Assignee: | Frank Warmerdam <warmerdam@pobox.com> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows NT | ||
Whiteboard: |
I believe this is a problem with how we invoke GNUplot with paths that have spaces in them. I notice that this only occurs with such paths to the FWTools directory, and that the histogram tool is not in the menu in this circumstace. The OBJ_2.png thing is a temporary file that is supposed to be created by gnuplot. I will dig into this. Likely requires a change to the core OpenEV.
Frank, there is a python-callable function exposed through _gv called get_short_path_name. On windows, this calls the appropriate win32 api function to retrieve the dos 8.3 compatible path. On linux, it simply returns the requested name. There is a small problem with the API that it requires the path to exist, so if you are trying to calculate the path to a file which does not yet exist, you should just get the short path name of the directory in which it is to be created. I created a small wrapper function in cietmap to avoid this error: def get_short_path_name(path): """ return a DOS 8.3 compatible name """ #TODO: try splitting the path and resolving #the short path of as much of the path as possible if not os.path.exists( path ): return path return _gv.gv_short_path_name(path)
I have changed the installer to use the short form of the directory name and this seems to solve the problem of loading intalled tools. It is possible there is still an issue with user supplied tools in a directory with spaces in it. If this comes up, we can revisit the problem.