Buildout doesn't honor exit code from scripts

Bug #697913 reported by Abhishek Mukherjee
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Buildout
Fix Released
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

Revision history for this message
Guy Rozendorn (guy-rozendorn) wrote :

this patch does sys(exit) on the result

Revision history for this message
Héctor Velarde (hvelarde-yahoo) wrote :

fixed on trunk, thanks!

Changed in zc.buildout:
status: New → Fix Committed
Revision history for this message
Remco Wendt (shanx) wrote :

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

Revision history for this message
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) ?

Revision history for this message
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.