Re: subprocess chokes on spaces in path

2007-11-07 Thread BartlebyScrivener
On Nov 6, 2:48 pm, Gabriel Genellina [EMAIL PROTECTED] wrote: Use a list of arguments [antiword, word_doc] and let subprocess handle the spaces the right way. Got it working. Thank you both. p = subprocess.Popen([antiword, word_doc], stdout=subprocess.PIPE) doc_text = p.stdout.read() rd

subprocess chokes on spaces in path

2007-11-06 Thread BartlebyScrivener
Using bash on Debian Etch. If word_doc = sys.argv[1] and it's a file name like My\ Word.doc this function reads My and Word as two separate files unless the second '%s' is quoted. Took me a lot of trial and error to discover. Is this the most elegant way to do it? I was using popen originally,

Re: subprocess chokes on spaces in path

2007-11-06 Thread Thorsten Kampe
* BartlebyScrivener (Tue, 06 Nov 2007 20:32:33 -) Using bash on Debian Etch. If word_doc = sys.argv[1] and it's a file name like My\ Word.doc this function reads My and Word as two separate files unless the second '%s' is quoted. Took me a lot of trial and error to discover. Is this

Re: subprocess chokes on spaces in path

2007-11-06 Thread Gabriel Genellina
En Tue, 06 Nov 2007 17:32:33 -0300, BartlebyScrivener [EMAIL PROTECTED] escribió: Using bash on Debian Etch. If word_doc = sys.argv[1] and it's a file name like My\ Word.doc this function reads My and Word as two separate files unless the second '%s' is quoted. Took me a lot of trial and