Proper exit code for buildout generated scripts

I recently ran into the issue that our Hudson installation didn’t report test failures. After digging for a bit, I discovered, that scripts installed by zc.recipe.egg don’t return the exit code for some cases. There is a bugreport at In our case the generated coverage script depended on this and because the sys.exit was missing, the test failures were masked.

The following is a way to fix this in your buildouts now until it’s fixed in zc.buildout:

extensions = buildout.extensionscripts
extension-scripts =

The patchScriptGeneration function in src/ looks like this:

def patchScriptGeneration(buildout):
    from zc.buildout import easy_install
    if not 'sys.exit(' in easy_install.script_template:
        easy_install.script_template = easy_install.script_template.replace(
Published in: on September 24, 2010 at 4:30 pm  Comments (1)