Buildout wrapper script swallows exceptions raised by starter #31

Closed
andrewclegg opened this Issue Mar 14, 2011 · 1 comment

2 participants

@andrewclegg

If your starter dies, its exit code is parsed out of the os.waitpid() call in util.py:system, then passed back via util.py:execute, cmd.py:start and cmd.py:dumbo.

If you're running dumbo from the entry script generated by easy_install, all is fine, as it captures the return value of the entry point (cmd.py:dumbo) and passes this to sys.exit().

But if you're using the wrapper generated by buildout, this return code is ignored, because of this issue:

https://bugs.launchpad.net/zc.buildout/+bug/697913

... meaning that your dumbo task as a whole still exits with 0, despite the exception in your starter.

I know this isn't really a bug in dumbo, but since dumbo is distributed via buildout, I thought it worth reporting. One workaround would be to add a line like this to cmd.py:dumbo:

if retval != 0:
    raise RuntimeError('%s command died with code %d') % (sys.argv[1], retval)

Arguably this is a more pythonic way to communicate an error condition than passing integers around anyway.

PS Thanks for fixing those last ones so quickly, Klaas :-)

@klbostee
Owner

use new 'execute_and_exit()' function as entry point for 'dumbo' console script to avoid buildout bug (closed by 76c7c9b)

@dangra dangra pushed a commit to dangra/dumbo that referenced this issue Apr 21, 2011
Klaas Bosteels use new 'execute_and_exit()' function as entry point for 'dumbo' cons…
…ole script to avoid buildout bug (fixes GH-31)
76c7c9b
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment