lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lilypond-book on windows


From: Phil Holmes
Subject: Re: lilypond-book on windows
Date: Wed, 11 Jan 2012 17:34:41 -0000

----- Original Message ----- From: "Trevor Daniels" <address@hidden> To: "Trevor Daniels" <address@hidden>; "Graham Percival" <address@hidden>; <address@hidden>
Cc: "Phil Holmes" <address@hidden>
Sent: Wednesday, January 11, 2012 2:32 PM
Subject: Re: lilypond-book on windows



Trevor Daniels wrote

Running lilypond-book
lilypond-book.py (GNU LilyPond) 2.15.25
Reading C:/Users/Trevor/LilyPond-git/Documentation/notation/contemporary.itely..
.
Running texi2pdf on file c:\users\trevor\appdata\local\temp\tmpt4vqnk.texi to de
tect default page settings.

Traceback (most recent call last):
File "c:/program files/lilypond/usr/bin/lilypond-book.py", line 739, in ?
   main ()
File "c:/program files/lilypond/usr/bin/lilypond-book.py", line 722, in main
   chunks = do_file (files[0])
File "c:/program files/lilypond/usr/bin/lilypond-book.py", line 595, in do_file
   global_options.formatter.init_default_snippet_options (source)
 File "out/book_texinfo.py", line 279, in init_default_snippet_options
 File "out/book_texinfo.py", line 213, in get_texinfo_width_indent
 File "/usr/lib/python2.4/subprocess.py", line 549, in __init__
OSError: [Errno 22] Invalid argument
Lilypond-book returned code 1

Graham

The invalid argument in subprocess.py is the U in
 self.stdout = os.fdopen(c2pread, 'rU', bufsize)
as I remarked some time ago.

The U means invoke universal newlines, see http://www.python.org/dev/peps/pep-0278/. I thought at first universal newlines might not be enabled, but it is, according to the test in the ref above.

If I remove the U from the calls to fdopen in lines 549 and 554 then I get:

Traceback (most recent call last):
 File "c:/program files/lilypond/usr/bin/lilypond-book.py", line 739, in ?
   main ()
File "c:/program files/lilypond/usr/bin/lilypond-book.py", line 722, in main
   chunks = do_file (files[0])
File "c:/program files/lilypond/usr/bin/lilypond-book.py", line 595, in do_file
   global_options.formatter.init_default_snippet_options (source)
File "c:\program files\lilypond\usr\share\lilypond\current\python\book_texinfo
.py", line 281, in init_default_snippet_options
texinfo_defaults = get_texinfo_width_indent (source, self.global_options); File "c:\program files\lilypond\usr\share\lilypond\current\python\book_texinfo
.py", line 216, in get_texinfo_width_indent
   (parameter_string, error_string) = proc.communicate ()
File "c:\Program Files\LilyPond\usr\lib\python2.4\subprocess.py", line 773, in
communicate
   stdout_thread.start()
File "c:\Program Files\LilyPond\usr\lib\python2.4\threading.py", line 418, in
start
   _sleep(0.000001)    # 1 usec, to let the thread run (Solaris hack)
IOError: (0, 'Error')
Unhandled exception in thread started by
Error in sys.excepthook:

Original exception was:
Lilypond-book returned code 1

If I then comment out the sleep in theading.py, lilypond-book runs to completion. It uses the default values for linewidth, etc, as it can't find texi2pdf, of course, just as if I'd bypassed Reinhold's code.

Trevor


I'd be a little wary of simply making this work on Windows by commenting code out, without ensuring there is no effect on other platforms. I'd be even more wary of doing this in a Python delivered file. It'd be a shame to break the doc build doing this. Even if the sleep command is bracketed with an if system=mingw, you still only have the same effect (making this run on windows with default values) as the earlier patch supplied. Far better to make a change we completely understand than get rid of a line that may be vital to the functioning on other platforms, while at the same time making upgrading Python even more difficult by customising the system code.

--
Phil Holmes





reply via email to

[Prev in Thread] Current Thread [Next in Thread]