lilypond-user
[Top][All Lists]
Advanced

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

Re: XML to .ly and Lilypond, again


From: Phil Holmes
Subject: Re: XML to .ly and Lilypond, again
Date: Sun, 14 May 2017 14:31:33 +0100

----- Original Message ----- From: "Leszek Wronski" <address@hidden>
To: <address@hidden>
Sent: Friday, May 12, 2017 12:54 PM
Subject: Re: XML to .ly and Lilypond, again


Dear Phil,

I read through the 2 pages of comments at the link you provided. Is
the ultimate suggestion the one in your last comment, that is, "I
believe this patch requires Python 2.7, and we ship 2.4. As a result,
windows users can no longer use musicxml2ly." ?

If so, I should just mention that I'm getting the errors on an Ubuntu
16.04 system with Python version 2.7.12.

Cheers,

Leszek.

OK - I've done some more looking at this. Using a test file produced by Sibelius, I get no problems using musicxml2ly on Ubuntu 14.04, Python 2.7.6. I think it would be helpful if people with other Ubuntu/Pytho versions could check an XML file (I can email my test to anyone who can check) to see whether the incorrect encoding of text is happening.

If I try the same file on Windows, with LilyPond 2.19.43, all is well. With 2.19.44 I get the same errors as Leszek:

Traceback (most recent call last):
File "C:\Program Files (x86)\LilyPondV2.19.44\usr\bin\musicxml2ly.py", line 3269, in ?
   main()
File "C:\Program Files (x86)\LilyPondV2.19.44\usr\bin\musicxml2ly.py", line 3263, in main
   voices = convert(filename, options)
File "C:\Program Files (x86)\LilyPondV2.19.44\usr\bin\musicxml2ly.py", line 3175, in convert
   score_information.print_ly(printer)
 File "out/musicexp.py", line 855, in print_ly
 File "out/musicexp.py", line 848, in format_header_strings
 File "out/musicexp.py", line 123, in newline
File "C:\Program Files (x86)\LilyPondV2.19.43\usr\lib\python2.4\codecs.py", line 501, in write
   return self.writer.write(data)
File "C:\Program Files (x86)\LilyPondV2.19.43\usr\lib\python2.4\codecs.py", line 178, in write
   data, consumed = self.encode(object, self.errors)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xa9 in position 39: unexpected code byte

However, if I try a file with a simpler header (e.g. 02d-Rests-Multimeasure-TimeSignatures.xml in the regtest suite), then the script runs successfully, but I get an output file with spurious nulls in text fields:

\header {
texidoc =
"&#0;M&#0;u&#0;l&#0;t&#0;i&#0;-&#0;M&#0;e&#0;a&#0;s&#0;u&#0;r&#0;e&#0; &#0;r&#0;e&#0;s&#0;t&#0;s&#0; &#0;s&#0;h&#0;o&#0;u&#0;l&#0;d&#0; &#0;a&#0;l&#0;w&#0;a&#0;y&#0;s&#0; &#0; &#0; &#0; &#0; &#0; &#0; &#0; &#0; &#0; &#0; &#0; &#0;b&#0;e&#0; &#0;c&#0;o&#0;n&#0;v&#0;e&#0;r&#0;t&#0;e&#0;d&#0; &#0;i&#0;n&#0;t&#0;o&#0; &#0;d&#0;u&#0;r&#0;a&#0;t&#0;i&#0;o&#0;n&#0;s&#0; &#0;t&#0;h&#0;a&#0;t&#0; &#0;a&#0;r&#0;e&#0; &#0;a&#0; &#0;m&#0;u&#0;l&#0;t&#0;i&#0;p&#0;l&#0;e&#0; &#0;o&#0;f&#0; &#0;t&#0;h&#0;e&#0; &#0;t&#0;i&#0;m&#0;e&#0; &#0; &#0; &#0; &#0; &#0; &#0; &#0; &#0; &#0; &#0; &#0; &#0;s&#0;i&#0;g&#0;n&#0;a&#0;t&#0;u&#0;r&#0;e&#0;.&#0;"
&#0;
}

So it looks clear that something probably introduced in https://sourceforge.net/p/testlilyissues/issues/4751/ is causing encoding problems on Windows. As I say, I can't reproduce the problem on Linux.

--
Phil Holmes



reply via email to

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