setup sub-command without any argument error

Bug #149352 reported by Baiju Muthukadan
2
Affects Status Importance Assigned to Milestone
Buildout
Fix Committed
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')

Revision history for this message
Baiju Muthukadan (baijum) wrote :
Revision history for this message
Jim Fulton (jim-zope) wrote : Re: [Bug 149352] setup sub-command without any argument error

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

Revision history for this message
Baiju Muthukadan (baijum) wrote :

Fixed in r80638

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

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

Revision history for this message
Philipp von Weitershausen (philikon) wrote :

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).

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

Other bug subscribers

Remote bug watches

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