bgr / mingus

Automatically exported from code.google.com/p/mingus
GNU General Public License v3.0
1 stars 1 forks source link

LilyPond extention get confused with filenames with spaces #34

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. use the LilyPond extention like that:
track = ...
output_file = os.path.join ('goal path', 'img')
LilyPond.to_png(track, output_file)
2.
3.

What is the expected output? What do you see instead?
expected:  files in path 'goal path/img/'

instead something like that:
Executing: lilypond -fpng -o media/songs/Bruder Jakob/media/images/Bruder
Jakob0.img media/songs/Bruder Jakob/media/images/Bruder Jakob0.img.ly
GNU LilyPond 2.10.33
aktuelles Verzeichnis kann nicht zu »media/songs« geändert werden

What version of the product are you using? On what operating system?
Ubuntu 8.10 64bit
mingus 0.3.9.1

Please provide any additional information below.
Using apostrophes '<filename>' around the files in the execution-string
should fix that

Original issue reported on code.google.com by s.huchler@gmail.com on 25 Feb 2009 at 2:29

GoogleCodeExporter commented 9 years ago
hmm k sorry its not a defect i think. 

so i used a workaround first generate it in /tmp directory then move it, but 
that
would not work under windows. also you should maybe check if mingus is called 
from
windows and then start lilypond.exe instead of lilypond.

So os.system would also not work with "filename" filenames dont know why but
os.system is deprecated anyway so it would be better to use subprocess.

the equilalent to os.system is:

 p = Popen(cmd, shell=True)
 sts = os.waitpid(p.pid, 0)

that works with "" around filenames with spaces.

http://docs.python.org/library/subprocess.html#replacing-os-system

Original comment by s.huchler@gmail.com on 25 Feb 2009 at 8:42

GoogleCodeExporter commented 9 years ago
The spaces problem should be fixed with "". Changing to subprocesses is fine 
too. 

I can't test on Windows, but I'm not sure if ".exe" needs to be added. Seems to 
be
mostly a PATH problem if lilypond can't be found. 

Original comment by Rhijnauwen@gmail.com on 25 Feb 2009 at 9:30

GoogleCodeExporter commented 9 years ago
ahh k, i did also not test under windows but when i think about it, i think you 
are
right. in dos-console you have not type in xxx.exe, xxx should work also. k i 
think
suprocess + "" should fix the problem.

Original comment by s.huchler@gmail.com on 26 Feb 2009 at 1:22

GoogleCodeExporter commented 9 years ago
Excellent, thanks for your report. I will fix this soon.

Original comment by Rhijnauwen@gmail.com on 27 Feb 2009 at 1:53

GoogleCodeExporter commented 9 years ago

Original comment by Rhijnauwen@gmail.com on 1 Mar 2009 at 5:47