[CCC DEV] occbuild on windows + split_options (really shlex.split)

cljacobsen at gmail.com cljacobsen at gmail.com
Wed Jul 14 04:14:36 BST 2010


Hi (Adam probably),

I've noticed that in occbuild.in, line 1006 a small helper fn: tool()
is defined which is used to extract paths to the various commands from
the environment or if not present in the environment use the preset
default. It uses os.getenv to pull out the value of the path from the
environment and this gets passed through the function split_options()
(which is really a call to shlex.split). I am wondering why it would
be necessary to call split_options (shlex.split) on the pathnames for
the commands? The reason I am asking is that when running in Windows
(where paths are separated with \ slashes...) the path separators get
mangled and disappear:
>>> import shlex
>>> shlex.split("C:\\blah\\moo\\grr")
['C:blahmoogrr']
>>>


Is there ever a time when the path names would need splitting? or
would it be ok to change the code:
        def tool(prog, default):
                programs[prog] = split_options(os.getenv(prog.upper(), default))
to
        def tool(prog, default):
                programs[prog] = [os.getenv(prog.upper(), default)]

Cheers,
  Christian




More information about the developers mailing list