Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profiler config does not carry command line arguments correctly #2736

Closed
rthouvenin opened this issue Oct 3, 2015 · 0 comments
Closed

Profiler config does not carry command line arguments correctly #2736

rthouvenin opened this issue Oct 3, 2015 · 0 comments

Comments

@rthouvenin
Copy link
Contributor

Currently their is no run configuration for the profiler. Issue #1110 was opened to request it and indeed it would be nice. In the meanwhile, from what I can see the profiler uses the Run config associated with the file. Indeed if I add command line options in the run config and start the profiler, the options are used. But there seem to be a bug in this mechanism. To reproduce:

  1. Create or open a file that parses the command line but accepts an empty one. For example:

    parser = argparse.ArgumentParser()
    parser.add_argument('--opt', dest='optionalarg')
    args = parser.parse_args()
    

    Profile it without giving command line options to make sure it's fine.

  2. Create or open another file that also parses the command line. Profile it with command line options that the first file would not accept.

  3. Come back to the first file, and profile it with F10

Expected behaviour: The file should be profiled with the options used during the first profiling (i.e. no option) .
Actual behaviour: It is run with the command line options that were given to the second file. If using my example, the argument parser will tell you that it encountered an unknown argument.

To workaround it, I have to open the Run config, put some command line arguments (even if don't want any), run the file, re-open the config, remove the arguments, and that's only when the file will be run as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants