Buildout -- Software for automating application assembly

setup sub-command without any argument error

Reported by Baiju Muthukadan on 2007-10-05
2
Affects Status Importance Assigned to Milestone
Buildout
Undecided
Baiju Muthukadan

Bug Description

"buildout setup" command raise an error like this:

An internal error occured due to a bug in either zc.buildout or in a
recipe being used:

IndexError:
pop from empty list

--------------------------

This error message should be improved. Here is a patch (please change message, if required):

Index: src/zc/buildout/buildout.py
===================================================================
--- src/zc/buildout/buildout.py (revision 80625)
+++ src/zc/buildout/buildout.py (working copy)
@@ -725,6 +725,10 @@
                 ep.load()(self)

     def setup(self, args):
+ if not args:
+ raise zc.buildout.UserError(
+ "setup command expects one argument.\n"
+ )
         setup = args.pop(0)
         if os.path.isdir(setup):
             setup = os.path.join(setup, 'setup.py')

On Oct 5, 2007, at 5:54 AM, Baiju Muthukadan wrote:

> Public bug reported:
>
> "buildout setup" command raise an error like this:
>
> An internal error occured due to a bug in either zc.buildout or in a
> recipe being used:
>
> IndexError:
> pop from empty list
>
> --------------------------
>
> This error message should be improved. Here is a patch (please change
> message, if required):
>
>
> Index: src/zc/buildout/buildout.py
> ===================================================================
> --- src/zc/buildout/buildout.py (revision 80625)
> +++ src/zc/buildout/buildout.py (working copy)
> @@ -725,6 +725,10 @@
> ep.load()(self)
>
> def setup(self, args):
> + if not args:
> + raise zc.buildout.UserError(
> + "setup command expects one argument.\n"

"one or more arguments".

Please feel free to go ahead and apply this. :)

Thanks.

Jim

--
Jim Fulton
Zope Corporation

Baiju Muthukadan (baijum) wrote :

Fixed in r80638

Changed in zc.buildout:
assignee: nobody → baijum
status: New → Fix Committed
Jim Fulton (jim-zope) wrote :

The patch (and subsequent checkin) lacked a test or a notation in CHANGES.txt.

Also, don't just tell people what they did wrong. Tell them how to make it right:

  The setup command expects at least one argument, the name of the directory that contains a setup.py. Further arguments will be passed along to that setup.py

(Note the missing article "The" in Baiju's original message).

Baiju Muthukadan (baijum) wrote :

Philipp, the message has changed by Jim like this, I think it's fine:

  The setup command requires the path to a setup script or
  directory containing a setup script, and it's arguments.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers