Buildout doesn't honor exit code from scripts

Bug #697913 reported by Abhishek Mukherjee on 2011-01-05
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Buildout
Undecided
Unassigned

Bug Description

if you return exit codes from your main script, Distribute at least will call sys.exit() on the return value. Buildout's resulting script, on the other hand, does not. For example, assume you have the foo/__init__.py:

def main():
    return 3

and the setup.py

...
setup(...
    entry_points='''
    [console_scripts]
    foo=foo:main
    ''''
)

On the resulting script from running setup.py install, you'd get a line similar to
if __name__ == '__main__':
    sys.exit(foo.main())

(it actually does some fancy load_entry_points logic that i'm skipping for conciseness). Buildout gives the equivalent line:
if __name__ == '__main__':
    foo.main()

Thus ignoring the return code to the main function

Guy Rozendorn (guy-rozendorn) wrote :

this patch does sys(exit) on the result

fixed on trunk, thanks!

Changed in zc.buildout:
status: New → Fix Committed
Remco Wendt (shanx) wrote :

Any idea when a new release will be done that includes this patch?

kleist (kleist) wrote :

Shouldn't this ticket be closed, since the bug was fixed by 2.0.0 (https://pypi.python.org/pypi/zc.buildout/2.1.0#id5) ?

Jim Fulton (jim-zope) wrote :

Yup

Changed in zc.buildout:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers