#8 boot_service.py w_getopt BUGFIX


I've notice that in file boot_service.py the w_getopt
function doesen't work as aspected.

This is the old broken code that forget to
remove the last ":" and never detect it adding
it twice in the if sentence:

if args[0][:1] in "/-":
arg = args[0][1:] # strip the '-' or '/'
arg = arg.lower()
if arg + ':' in options:

This is the new code that add the ":" case:

if args[0][:1] in "/-":
arg = args[0][1:] # strip the '-' or '/'
arg = arg.lower()
if arg.endswith(":") : # strip the ':'
arg = arg[:-1]
if arg + ':' in options:

Thanks in advance,
luca <l.montecchiani@teamsystem.com>


  • Nobody/Anonymous

    Logged In: NO

    Oops the new code with indentation made with "_" :

    if args[0][:1] in "/-":
    ____arg = args[0][1:] # strip the '-' or '/'
    ____arg = arg.lower()
    ____if arg.endswith(":") : # strip the ':'
    ________arg = arg[:-1]
    ____if arg + ':' in options:

  • Mark Hammond

    Mark Hammond - 2006-06-02

    Logged In: YES

    Note that the trailing ':' is *not* supposed to be specified
    on the command-line - like the getopt module, that simply
    indicates that the option requires an argument.

    For example, a command-line could be:

    foo.py -install -user username

    Note that -install requires no args, but -user does. Note
    that the ':' is never added to the cmdline.

    Please reopen this bug if I have misunderstood, but please
    include an example of a valid command-line that fails to
    work with the existing code.

  • Mark Hammond

    Mark Hammond - 2006-06-02
    • status: open --> closed-invalid

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks