[Biopython-dev] [Bug 2967] New: AbstractCommandline silently accepts invalid parameter options

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Wed Dec 9 10:07:14 UTC 2009


http://bugzilla.open-bio.org/show_bug.cgi?id=2967

           Summary: AbstractCommandline silently accepts invalid parameter
                    options
           Product: Biopython
           Version: 1.52
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Main Distribution
        AssignedTo: biopython-dev at biopython.org
        ReportedBy: lpritc at scri.sari.ac.uk


While investigating Bug 2996 I noticed that AbstractCommandline was silently
accepting invalid parameter options when passed by setting attributes.  For
example:

    cline = Primer3Commandline(bogus=True)
    cline.sequence = filename

raises the appropriate ValueError, as the parameter name 'bogus' is being
compared to the self.parameters list when setting, and is found not to be
valid.  However, the following code:

    cline = Primer3Commandline()
    cline.sequence = filename
    cline.bogus = True    # Invalid argument not flagged up
    cline.sequnce = True  # Mistyped argument not flagged up


silently sets the invalid cline.bogus and cline.sequnce attributes without
warning.  Parameters set via attribute are not validated with the
setter/getters defined for the properties in AbstractCommandline.__init__  This
could (did!) lead the user to think that parameters are set when they are not,
under at least two circumstances:

1) Typos in the parameter name
2) Using a parameter unsupported by the interface (see Bug 2996).

L.


-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the Biopython-dev mailing list