[issue12420] distutils crashes if PATH is not defined

2011-06-27 Thread Henry Precheur
Henry Precheur added the comment: I think that returning None would be a better option. The function documentation says: Tries to find 'executable' in the directories listed in 'path'. A string listing directories separated by 'os.pathsep'; defaults to os.environ['PATH']. Returns the co

[issue12420] distutils crashes if PATH is not defined

2011-06-27 Thread Éric Araujo
Éric Araujo added the comment: Okay, I see the original use case (#12401). I think the proper thing to do is to skip tests that rely on the environment being non-empty. -- ___ Python tracker

[issue12420] distutils crashes if PATH is not defined

2011-06-27 Thread Henry Precheur
Henry Precheur added the comment: I don't know exactly in which context find_executable should be used, but after taking a closer look it seems that returning None when PATH is not defined could "work". -- ___ Python tracker

[issue12420] distutils crashes if PATH is not defined

2011-06-27 Thread Henry Precheur
Henry Precheur added the comment: Sorry "crash" wasn't the right term. It's just that distutils tests fail. I ran into that when trying to run unit tests without any environment variable (see #12401). $ env -i ./python ./Lib/test/regrtest.py test_distutils [1/1] test_distutils test test_distut

[issue12420] distutils crashes if PATH is not defined

2011-06-27 Thread Éric Araujo
Éric Araujo added the comment: Thanks for the report. Can you tell how you ran into this? Did you call the function directly, or did you get the bug while running a setup.py command? Also, what do you mean by crash? We use that for CPython segmentation faults, not regular misbehavior. If

[issue12420] distutils crashes if PATH is not defined

2011-06-27 Thread Henry Precheur
New submission from Henry Precheur : The function find_executable crashes if PATH is not defined. I admit that it's an extreme case, but it's probably better to on the safe side of things. What about using the current directory only if PATH is not defined? This seems to be a reasonable workar