I have a filename like "Nena - Nur getraeumt (1982) HD 0815007.mp3" - I can see it in the directory , however in a python subprocess - my code says the file isn't found. Is there a way to bypass or encode the string in such a way that it can find the file? Here is my code fragment:
try:
p = subprocess.Popen(["avconv" , "-y" , "-i" , upload_music_file , "-acodec" , "pcm_s16le" , process_file], universal_newlines=True, stdout=subprocess.PIPE)
out, err = p.communicate()
retcode = p.wait()
except IOError:
pass
Assuming upload_music_file is "Nena - Nur getraeumt (1982) HD 0815007.mp3" and process_file is "proccess_music.mp3"
I get the error:
avconv version 0.8.12-6:0.8.12-1, Copyright (c) 2000-2014 the Libav developers built on Jun 1 2014 17:03:01 with gcc 4.7.2 /music/Nena - Nur getraeumt (1982) HD 0815007.mp3 : No such file or directory
My only clue is when trying to ls the file from bash it get: -bash: syntax error near unexpected token `('
is there a way to process the upload_music_file string so it'll work?