Stop args from containing a single empty string

Review Request #5263 — Created Jan. 15, 2014 and discarded

Information

RBTools
master

Reviewers

Stop args from containing a single empty string

Sometimes (I haven't tracked down quite where) OptionParser will return
args as ['']. This can get interpreted as a revision range by the clients
(in particular git), which can confuse matters - the git client tries to
run `git rev-parse `, which fails, for instance.

Therefore remove emptystring from the args return from OptionParser.

Untested on any clients except git.

 
Description From Last Updated

This will only remove a single instance. If we decide that this is really something that should be done, instead …

daviddavid
david
  1. I'd feel much better about this if you tracked down why this was occurring. I've never seen it.

  2. rbtools/commands/__init__.py (Diff revision 1)
     
     
     
    Show all issues

    This will only remove a single instance. If we decide that this is really something that should be done, instead of testing and calling .remove(), how about filtering all empty arguments out with a list comprehension?

    args = [a for a in args if a]
    
    1. This is caused by something in a shell script we were using (excess quotes around a variable with sometimes empty value)

  3. 
      
CA
Review request changed
Status:
Discarded
Change Summary:
Seemingly abandoned.