Console scripts do not call sys.exit

Bug #164629 reported by Ashley Walsh
28
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Buildout
Fix Committed
Undecided
Unassigned

Bug Description

When a 'console_script' is installed by easy_install it uses::

    sys.exit(
        load_entry_point(...)()
        )

A script installed by buildout does not call sys.exit(), so it does not match the
behaviour of easy_install.

Revision history for this message
kumar303 (kumar-mcmillan) wrote :

Hi. This is a problem for sphinx-build because running the doctest builder does not exit non-zero in a Makefile. This probably affects lots of other scripts since easy_install proper will create a script that exits non-zero.

Here is a patch that is working for me to fix the problem. I have not tried to run the zc.buildout test suite after this change though.

Revision history for this message
Olaf Conradi (olaf-conradi) wrote :

I ran into the same problem.
Any chance the attached patch can be merged?

Thanks

Revision history for this message
Jan-Jaap Driessen (janjaapdriessen) wrote :

I ran into this problem when installing py.test with zc.recipe.egg (and z3c.recipe.scripts). A *hack* to achieve the wanted behavior is:

[py.test]
recipe = z3c.recipe.scripts
eggs = py.test
            ...
script-initialization =
  import pytest
  if __name__ == '__main__': sys.exit(pytest.main())

Revision history for this message
Andrew Clegg (andrew-clegg-signups) wrote :

This bug was reported over 3 years ago and patched well over a year ago -- any decision on merging it in?

Revision history for this message
Jim Fulton (jim-zope) wrote : Re: [Bug 164629] Re: Console scripts do not call sys.exit

On Mon, Mar 14, 2011 at 3:06 PM, Andrew Clegg <email address hidden> wrote:
> This bug was reported over 3 years ago and patched well over a year ago
> -- any decision on merging it in?

I think it will happen at the sprints this week.

Jim

--
Jim Fulton
http://www.linkedin.com/in/jimfulton

Revision history for this message
Takeshi KOMIYA (i-tkomiya) wrote :

Hi, I met this problem too.
Is there any problem to apply the fix?

I'm replacing generated scripts with sed command now...

Revision history for this message
Jim Fulton (jim-zope) wrote :

This will be fixed in buildout 1.6.0, which should be released in a few days.

Changed in zc.buildout:
status: New → Fix Committed
Revision history for this message
Alin Voinea (avoinea) wrote :

Where is version 1.6.0?

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.