Skip to content

incorrect string to bool conversions when parsing command line arguments #197

@abolshov

Description

@abolshov

When appending command line arguments for further ps_call via analysisCacheProducer_cmd.extend(["--compute_unc_variations", "True"]), incorrect string to bool conversion occurs: no matter what the value of the string command line argument is, after adding it as parser.add_argument("--compute_unc_variations", type=bool, default=False), resulting argument is converted to bool as string, meaning that if the string is not empty, args.compute_unc_variations=True (even if --compute_unc_variations was passed as False). To reproduce one can run e.g. AnalysisCacheTask with --compute_unc_variations False and print args.compute_unc_variations from AnalysisCacheProducer. I suspect that might be an issue in more places.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions