shell command needs whitespace characters escaped

2006-12-08 Thread metaperl
I downloaded a file which has a space in the filename. I want to run a shell unzip on it, but it fails in my current code: syscmd = cd %s ; unzip %s % (self.storage.input, file.basename()) os.system(syscmd) because no escaping was done. Is there a more principled way to

Re: shell command needs whitespace characters escaped

2006-12-08 Thread Klaus Alexander Seistrup
Metaperl wrote: I downloaded a file which has a space in the filename. I want to run a shell unzip on it, but it fails in my current code: syscmd = cd %s ; unzip %s % (self.storage.input, file.basename()) os.system(syscmd) because no escaping was done. Using cd '%s' ;

Re: shell command needs whitespace characters escaped

2006-12-08 Thread Fredrik Lundh
metaperl wrote: I downloaded a file which has a space in the filename. I want to run a shell unzip on it, but it fails in my current code: syscmd = cd %s ; unzip %s % (self.storage.input, file.basename()) os.system(syscmd) because no escaping was done. Is there a more

Re: shell command needs whitespace characters escaped

2006-12-08 Thread Nick Craig-Wood
Fredrik Lundh [EMAIL PROTECTED] wrote: metaperl wrote: I downloaded a file which has a space in the filename. I want to run a shell unzip on it, but it fails in my current code: syscmd = cd %s ; unzip %s % (self.storage.input, file.basename()) os.system(syscmd)