bug-lilypond
[Top][All Lists]
Advanced

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

Re: lilypond-book 2.11.43 broken


From: Trevor Bača
Subject: Re: lilypond-book 2.11.43 broken
Date: Sun, 13 Apr 2008 12:48:16 -0500

On Wed, Mar 26, 2008 at 1:49 AM, Graham Percival <address@hidden> wrote:

> On Tue, 25 Mar 2008 23:05:35 -0300
> "Han-Wen Nienhuys" <address@hidden> wrote:
>
> > 2008/3/25, Graham Percival <address@hidden>:
> > > lilypond-book 2.11.43 from OSX GUB is broken for normal usage (ie
> > >  I'm not complaining about the docs here.  :)
> > >
> > >  I don't quite know enough about python to figure out what you're
> > >  trying to do on line 1633, sorry.
> >
> > is this py 2.3 or 2.4 ?
>
> 2.4.4 -- I installed an updated python from macports for some
> other software (although I can't think of what it was right now).
>
> lilypond-book in 2.11.42 worked fine.  For now I just copied the
> script from the 2.11.42 GUB and dumped it inside the 2.11.43
> package.
>


Hi Graham, hi Han-Wen,

Similar problem here when I upgraded to 2.11.43-2 on my OS X (10.4 -- *not*
Leopard) box at home this morning. It appears to be a python versioning
problem. The OS directive at the head of lilypond-book is finding python
with #!/usr/bin/python ... which aliases to python 2.3.5 on my system; this
is a spurious python install on my box. I prefer to use python 2.5 and
"which python" gives
/Library/Frameworks/Python.framework/Versions/Current/bin/python, (which is,
in fact, 2.5).

So, what this comes out to mean is that the global references to the set( )
constructor in lilypond-book all break if /usr/bin/python is used because
set( ) didn't become a python built-in until 2.4 (or thereabouts). Yes, I
know it's weird for me to have multiple versions of python installed on my
box and I can't remember why it's like this ... something to do with the
.dmgs I downloaded. But the real solution is for lilypond-book to summon
whatever version of python appears on the user path; in my case this will be
python 2.5, set( ) will be built-in, and everything will work great.

I don't understand lilypond-book well enough to change the version of python
that the script is looking for. But adding ...

  from sets import Set as set

... to the import statements at the head of the script fixes the problem for
now.

Odd that everything worked great through 2.11.41, at least, and the set( )
stuff only becomes a problem in 2.11.43.


### DETAILS ###

Minimal lilypond-book test file:

   \documentclass[10pt]{article}
   \begin{document}
   hello, world!
   \begin{lilypond}
      \new Staff {
         c'4
      }
   \end{lilypond}
   \end{document}

Notice ...

   $ /usr/bin/python -V
   Python 2.3.5

... but ...

   $ which python
   /Library/Frameworks/Python.framework/Versions/Current/bin/python
   $ `which python` --version
   Python 2.5


Then, output from lilypond-book 2.11.43 under OS X 10.4.11:

$ lilypond-book --pdf --out=out test.tex
lilypond-book (GNU LilyPond) 2.11.43
Reading test.tex...
Running latex...This is pdfTeXk, Version 3.141592-1.40.3 (Web2C 7.5.6)
 %&-line parsing enabled.
entering extended mode
(/tmp/tmpvQnECb.tex
LaTeX2e <2005/12/01>
Babel <v3.8h> and hyphenation patterns for english, usenglishmax, dumylang,
noh
yphenation, arabic, basque, bulgarian, coptic, welsh, czech, slovak, german,
ng
erman, danish, esperanto, spanish, catalan, galician, estonian, farsi,
finnish,
 french, greek, monogreek, ancientgreek, croatian, hungarian, interlingua,
ibyc
us, indonesian, icelandic, italian, latin, mongolian, dutch, norsk, polish,
por
tuguese, pinyin, romanian, russian, slovenian, uppersorbian, serbian,
swedish,
turkish, ukenglish, ukrainian, loaded.

(/usr/local/texlive/2007/texmf-dist/tex/latex/base/article.cls
Document Class: article 2005/09/16 v1.4f Standard LaTeX document class
(/usr/local/texlive/2007/texmf-dist/tex/latex/base/size10.clo))
No file tmpvQnECb.aux.
textwidth=345.0pt
columnsep=10.0pt
(./tmpvQnECb.aux) )
No pages of output.
Transcript written on tmpvQnECb.log.
Dissecting...
Traceback (most recent call last):
  File "/Applications/LilyPond.app/Contents/Resources/bin/lilypond-book",
line 1930, in ?
    main ()
  File "/Applications/LilyPond.app/Contents/Resources/bin/lilypond-book",
line 1912, in main
    chunks = do_file (files[0])
  File "/Applications/LilyPond.app/Contents/Resources/bin/lilypond-book",
line 1821, in do_file
    do_process_cmd (chunks, input_fullname, global_options)
  File "/Applications/LilyPond.app/Contents/Resources/bin/lilypond-book",
line 1657, in do_process_cmd
    output_files = set(os.listdir(options.lily_output_dir))
NameError: global name 'set' is not defined



Adding ...

import md5
import os
import re
import stat
import sys
import tempfile
from sets import Set as set  # new line 37

...enables python 2.3.5 to reference the set constructor globally.



HTH. Not exactly the same problem Graham was reporting, but perhaps related.

Trevor.



-- 
Trevor Bača
address@hidden

reply via email to

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