Running lilypond-book fromversion 2.7.39 in Windows now results in:

Traceback (most recent call last):
 File "C:\Program Files\LilyPond\usr\bin\lilypond-book.py", line 75, in ?
   import lilylib as ly
 File "out/lilylib.py", line 17, in ?
File "C:\Program Files\LilyPond\usr\lib\python2.4\subprocess.py", line 377, in
?
   import fcntl
ImportError: No module named fcntl


I don't really understand why we could not include the full subprocess
module in the Python included in the lilypond package. It's included in the native Windows version of Python available at www.python.org, so it's
certainly not impossible.

Regarding the other remaining lilypond-book + Windows related bug, the following hack is one possible solution. A cleaner solution is probably to send the arguments as a sequence to subprocess.Popen, which avoids all problems with quoting arguments. However, then the -P flag to lilypond-book won't work of you want to supply arguments there.

Index: python/lilylib.py
===================================================================
RCS file: /sources/lilypond/lilypond/python/lilylib.py,v
retrieving revision 1.80
diff -p -u -u -r1.80 lilylib.py
--- python/lilylib.py   17 Mar 2006 15:45:34 -0000      1.80
+++ python/lilylib.py   19 Mar 2006 10:12:28 -0000
@@ -60,6 +60,16 @@ except:
underscore = _
progress = sys.stderr.write +# Modified version of the commands.mkarg(x):
+def mkarg(x):
+    s = ' "'
+    for c in x:
+        if c in '\\$"`':
+            s = s + '\\'
+        s = s + c
+    s = s + '"'
+    return s
+

def command_name (cmd):
        # Strip all stuf after command,
Index: scripts/lilypond-book.py
===================================================================
RCS file: /sources/lilypond/lilypond/scripts/lilypond-book.py,v
retrieving revision 1.309
diff -p -u -u -r1.309 lilypond-book.py
--- scripts/lilypond-book.py    15 Mar 2006 13:48:10 -0000      1.309
+++ scripts/lilypond-book.py    19 Mar 2006 10:12:29 -0000
@@ -31,7 +31,6 @@ TODO:
import stat
import string
import tempfile
-import commands
import os
import sys
import re
@@ -1699,7 +1698,7 @@ def main ():
                              + ' --formats=%s --backend eps ' % formats

        if global_options.process_cmd:
-               global_options.process_cmd += string.join ([(' -I %s' % 
commands.mkarg (p))
+               global_options.process_cmd += string.join ([(' -I %s' % 
ly.mkarg (p))
                                                            for p in 
global_options.include_path])

        identify ()
Index: ChangeLog
===================================================================
RCS file: /sources/lilypond/lilypond/ChangeLog,v
retrieving revision 1.4775
diff -p -u -u -r1.4775 ChangeLog
--- ChangeLog   19 Mar 2006 03:35:33 -0000      1.4775
+++ ChangeLog   19 Mar 2006 10:15:47 -0000
@@ -1,3 +1,11 @@
+2006-03-19  Mats Bengtsson  <[EMAIL PROTECTED]>
+
+       * scripts/lilypond-book.py (LATEX_INSPECTION_DOCUMENT): idem
+
+       * python/lilylib.py (mkarg): Modified version of commands.mkarg
+       that always adds double quotes. Fixes quoting problems on
+       mingw. +
2006-03-17  Graham Percival  <[EMAIL PROTECTED]>

        * Documentation/user/ examples, instrument-notation,


  /Mats




_______________________________________________
bug-lilypond mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-lilypond

Reply via email to