Originally created by: *anonymous
Originally created by: ColinPKC...@gmail.com
Reported by Eluze:
Although AU suggests that convert-ly output can be redirected to preserve the input file, python throws an error under Windows 7:
Traceback (most recent call last):
File "C:\Program Files (x86)\LilyPond\usr\bin\convert-ly.py", line 386, in ?
main ()
File "C:\Program Files (x86)\LilyPond\usr\bin\convert-ly.py", line 367, in main
errors += do_one_file (f)
File "C:\Program Files (x86)\LilyPond\usr\bin\convert-ly.py", line 320, in do_one_file
outfile.close()
IOError: [Errno 9] Bad file descriptor
The issue may result from code near line 308-322 in convert-ly, where outfile becomes an alias for stdout. DAK suggests that convert-ly should only close files it created. The issue seems to be with Windows only.
Original discussion at http://lilypond.1069038.n5.nabble.com/convert-ly-from-the-commandline-under-windows-corrupted-td149284.html
Originally posted by: Elu...@gmail.com
Issue 3509 has been merged into this issue.
Originally posted by: dak@gnu.org
I don't see any call of outfile.close. In the vicinity there is
outfile.write (result)
but that's not anything like that. I can't find anything like it in the remove history of convert-ly either. This is rather puzzling. Do we have version info for the problem?
Originally posted by: Elu...@gmail.com
in the original discussion I reported about my trial to replace the flush statement -sys.stderr.flush () - with outfile.close()
Originally posted by: dak@gnu.org
What happens if you just outcomment sys.stdout.flush() without any replacement?
Originally posted by: Elu...@gmail.com
no error, conversions are applied but the new file is empty (and if I put some text in it it is removed)
Originally posted by: dak@gnu.org
This is borked to a degree where I'd recommend getting a new version of Python. Is this a version of Python that we deliver ourselves?
Originally posted by: Elu...@gmail.com
Python 2.4.5 (#1, Mar 11 2013, 11:08:29)
[GCC 4.1.1] on mingw32
delivered with the Lilypond installer
Originally posted by: PhilEHol...@googlemail.com
I've just installed LilyPond on my little Windows 7 netbook and can get convert-ly working with redirection without problem:
C:\Program Files\LilyPond\usr\bin>python convert-ly.py ChangeLeftHand.ly >new.ly
convert-ly.py (GNU LilyPond) 2.17.25
convert-ly.py: Processing `ChangeLeftHand.ly'...
Applying conversion: 2.17.0, 2.17.4, 2.17.5, 2.17.6, 2.17.11, 2.17.15, 2.17.18,
2.17.19, 2.17.20, 2.17.25
Of possible note is that I run it as 'python convertly.py'; simple typing 'convert-ly' gives "'convert-ly' is not recognized as an internal or external command,
operable program or batch file."
This is Windows 7 Starter.
Originally posted by: Elu...@gmail.com
here (Windows 7 Home Premium) I get:
python: can't open file 'convert-ly.py': [Errno 2] No such file or directory
the command I use is:
python convert-ly.py test5.ly > new.ly
however, I'm not on C:\Program Files\LilyPond\usr\bin>, I'm on test5.ly dir
Everything works as expected here (Windows 7) if you use absolute path, either with bundled python (currently 2.4.5) and with my python installation (2.7.14):