windows / unix path

Tim Roberts timr at probo.com
Thu Oct 23 03:04:01 EDT 2008


greg <greg at cosc.canterbury.ac.nz> wrote:
>
>Dennis Lee Bieber wrote:
>> The command line is the only place the slash direction has any
>> effect any way... Avoid os.system(), subprocess with shell = True, and
>> forward is safe in any position.
>
>I'm not sure that's quite true. On Windows, it's not the
>shell that splits up the command line into arguments, it's
>the program being run. So you need to avoid any kind of
>exec or spawn operation, whether it goes through the shell
>or not, unless you know the program being run isn't going
>to interpret '/' as an option.

Well, you actually said the same thing as Dennis here, in a slightly
different way.

The executive summary here is that the Windows APIs all accept either
forward or backward slashes just fine.  The trouble happens when you start
using command lines, just as Dennis said.
-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the Python-list mailing list