
distutils/core.py contains this code, in the setup() function: # And finally, run all the commands found on the command line. if ok: try: dist.run_commands() except KeyboardInterrupt: raise SystemExit, "interrupted" except (IOError, os.error), exc: error = grok_environment_error(exc) if DEBUG: sys.stderr.write(error + "\n") raise else: raise SystemExit, error except (DistutilsError, CCompilerError), msg: if DEBUG: raise else: raise SystemExit, "error: " + str(msg) In my case, I have a custom "test" command in my setup script, which imports test scripts from a unittests directory. As it goes, the importing of one of the script fails with an OSError. This is my fault, of course, but it seems distutils tries all to hide the error from the user. On Windows, the output of the setup script is: running test running build running build_py running build_ext error: Das angegebene Modul wurde nicht gefunden and on Linux, even worse: running test running build running build_py running build_ext error: None I've tried to find out what's wrong, and eventually found the DISTUTILS_DEBUG environment variable. When this is set, the full traceback is printed (among a lot of other output). IMO this behaviour is not helpful, and the DISTUTILS_DEBUG variable is undocumented. In which way should this be changed? Thomas

Thomas Heller wrote:
I believe the motivation for this was simply to reduce the depth of tracebacks; consider an administrator who doesn't know much about Python and is trying to install a package. If they get a big long traceback from deep inside the guts of Distutils, they may think the package or the Python installation is broken because they don't read all the way down to the bottom and see that it's a permission problem. I suggest just documenting the DISTUTILS_DEBUG variable, but otherwise leaving this alone. --amk

"A.M. Kuchling" <amk@amk.ca> writes:
Suggested patch submitted as http://www.python.org/sf/761401. Thomas

Thomas Heller wrote:
I believe the motivation for this was simply to reduce the depth of tracebacks; consider an administrator who doesn't know much about Python and is trying to install a package. If they get a big long traceback from deep inside the guts of Distutils, they may think the package or the Python installation is broken because they don't read all the way down to the bottom and see that it's a permission problem. I suggest just documenting the DISTUTILS_DEBUG variable, but otherwise leaving this alone. --amk

"A.M. Kuchling" <amk@amk.ca> writes:
Suggested patch submitted as http://www.python.org/sf/761401. Thomas
participants (2)
-
A.M. Kuchling
-
Thomas Heller