Le 30/01/2021 à 08:08, James B. Wilkinson a écrit :
MacBook Pro Mavericks. I picked "Update Syntax" from the Lilypond Compile menu. I added a line of code in the offending file asking it to print the Python version. It’s 2.6.6 and was created by Apple. Just now I ran this: /Applications/LilyPond.app/Contents/Resources/bin/convert-ly chloris.ly and redirected the output into a file. Worked like a champ, and changed the version in the file to 2.22. Opened that file in lily pond and compiled it; also worked like a champ. So I tried putting the python3 shebang line at the beginning of convert-ly.py but discovered that it’s already there. Then I tried putting it in the file lilylib.py that actually threw the error. It wasn’t already there, but adding it did not fix anything. Somehow the decision to use the Apple 2.6.6 has been made before it starts to read convert-ly.py, and nothing is going to change its mind about that. I’ll go send this to the bug list right now.
Thanks!
As a slightly related aside, can somebody point me to an explanation of the line of code that is cited in the error message? sys.stdin = codecs.getreader('utf8')(sys.stdin.detach()) My Python skills don’t reach far far enough to grok that syntax. thanks
It forces the standard input stream to be read in UTF-8 encoding. See https://stackoverflow.com/a/4374457 Best, Jean