Geoffrey Lloyd wrote:
> Stephen Harris wrote:
>> If this is a problem with Ghostscript, rather than paths with spaces, or
>> LyX, why did "gswin32.exe 0lsypreview.ps" work? Was Ghostscript
>> used to create 0lsypreview.ps?
> Hmmm good point. Wherever Lyx is the temp directory still has paths with
> spaces and so 0lyxpreview.ps still has spaces in its path.
>
> Maybe it is something to do with the path to GS having spaces in this
> case but we have stumbled across another problem with GS which is not
> related.
>
> I honestly couldnt say.
Me neither. However, there *is* a problem with the lyxpreview2ppm.py script
when the path to the executable contains spaces. Perhaps you could see if
the attached patch fixes things?
--
Angus
Index: lib/scripts/lyxpreview2ppm.py
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/scripts/Attic/lyxpreview2ppm.py,v
retrieving revision 1.1.2.7
diff -u -p -r1.1.2.7 lyxpreview2ppm.py
--- lib/scripts/lyxpreview2ppm.py 16 Jun 2005 13:15:11 -0000 1.1.2.7
+++ lib/scripts/lyxpreview2ppm.py 8 Dec 2005 00:24:45 -0000
@@ -93,7 +93,11 @@ def find_exe(candidates, path):
full_path = os.path.join(directory, prog)
if os.access(full_path, os.X_OK):
- return full_path
+ # The thing is in the PATH already (or we wouldn't
+ # have found it). Return just the basename to avoid
+ # problems when the path to the executable contains
+ # spaces.
+ return os.path.basename(full_path)
return None