should these be fixed for python 2.4?

Michele Simionato michele.simionato at gmail.com
Sat Oct 2 03:19:46 EDT 2004


Jeff Shannon <jeff at ccvcorp.com> wrote in message news:<10lrp62cr2uqc5a at corp.supernews.com>...
> 
> Personally, I suspect that the number of people who're running external 
> commands that are complex enough for these escaping issues to matter is 
> rather small.  The vast majority of uses of os.system() (IMHO) are very 
> simple cases with one or two simple arguments.  Relatively few of them 
> involve filenames that contain spaces, or other things that might cause 
> problems with the naive os.system('cmd %s %s' % (arg1, arg2)) sort of 
> approach.
> 
> At least, *I've* never personally found myself in a situation where I 
> wanted to execute an external command, and in which I needed to worry 
> about escaping/quoting the command string.  It's an open question 
> whether your experience is more typical than mine, I guess...
> 

Well, if I may add a data point, it happened to me various times
of getting in trouble with os.system and quotes when managing
Windows files. I know about os.spawn*, but it is a knowledge that
keeps escaping from my mind. I would keep os.system as it is,
but I would modify the documentation (or maybe the docstring of
os.system) pointing out the existence of os.spawn*.
Just my 0.02c,


              Michele Simionato



More information about the Python-list mailing list