-
Notifications
You must be signed in to change notification settings - Fork 44
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
CWP change to argparse breaks shortcuts to execute module with -m option #177
Comments
JTignor-Raltron
added
the
type::bug
describes erroneous operation, use severity::* to classify the type
label
Jan 25, 2024
I've come back to report I've found a solution, although it required the use of a feature that isn't in the argparse documentation anymore, although it's not planned to be removed. If you instead set |
Awesome, do you want to submit a PR with the change or would you rather us handle it? |
JTignor-Raltron
added a commit
to JTignor-Raltron/menuinst
that referenced
this issue
Jan 26, 2024
Parameters that start with "-" are interpreted as a new argument. argparse.REMAINDER forces it to interpret all everything left in the command as a list of strings instead of new arguments. Fixes issue conda#177
jaimergp
added a commit
that referenced
this issue
Jan 26, 2024
* Fix commands with arguments that start with "-" Parameters that start with "-" are interpreted as a new argument. argparse.REMAINDER forces it to interpret all everything left in the command as a list of strings instead of new arguments. Fixes issue #177 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add test * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update tests/_legacy/test_cwp.py --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: jaimergp <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Checklist
What happened?
I have not been the best about keeping my dev computer up to date, so this presented itself when I went to set up a new computer with our production software. We create shortcuts that execute cwp.py using pythonw providing the command to execute pythonw within the relevent environment with the
-m
option to run our module. These shortcuts did not work on the new machine. Trying to diagnose the issue I attempted to run the shortcut command manually on the terminal (using python instead of pythonw to get feedback:python [Anaconda install location]\cwp.py [environment prefix] [environment prefix]pythonw -m my.module
) and got this error:usage: cwp.py [-h] [--no-console] prefix [args ...] cwp.py: error: unrecognized arguments: -m my.module
I reported this yesterday in issue #167 but after a nights sleep I had an epiphany and not only do I realize this is a different issue, but I realized the cause. argparse is interpreting the -m as a new argument instead of part of the
args
argument. Did a little research to try to find a solution, but haven't found one so far.Conda Info
No response
Conda Config
No response
Conda list
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: