question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Setting credentials fails when password starts with a hyphen

See original GitHub issue
  • I am on the latest Poetry version.

  • I have searched the issues of this repo and believe that this is not a duplicate.

  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

  • OS version and name: NixOS 21.05

  • Poetry version: 1.1.11

Issue

When setting repository credentials with poetry config http-basic.custom-repo gitlab-ci-token ${GITLAB_JOB_TOKEN} the command will fail any time the GITLAB_JOB_TOKEN begins with a hyphen. The command line parser tries to treat the password as an option.

The current workaround is to use double hyphen e.g. poetry config http-basic.custom-repo -- gitlab-ci-token ${GITLAB_JOB_TOKEN}

This should either be fixed in the option parser, or the workaround documented in the manual.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
neersightedcommented, Nov 1, 2022

Agreed, this is standard behavior of CLI applications, and there is no need for a workaround as the proper solution (-- to terminate options parsing in the Unix tradition) is available. I’m leaving this open as this seems like an excellent FAQ candidate.

1reaction
dimblebycommented, Oct 31, 2022

this is just regular behaviour for command line programs. eg try to grep for a string that begins with a hyphen: it’ll try to interpret it as an option.

See also #4853.

Nothing to do here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Characters that are valid for user IDs and passwords - IBM
Understanding character limitations for user IDs and passwords is important because they are used throughout IBM® Business Automation Workflow to provide ...
Read more >
Error when you create a user name that contains a special ...
A Windows Live error occurred while provisioning for "user+invalid_characters@contoso.com". The e-mail name contains invalid characters.
Read more >
hand typing password always fails. - 1Password Community
Is it possible that the dashes included by iPassword when it generated the password are not the ones on the keys? I.e. it's...
Read more >
<input type="password"> - HTML: HyperText Markup Language
When setting the value of a password control, line feed and carriage ... The input will fail constraint validation if the length of...
Read more >
AWS::SecretsManager::Secret - AWS CloudFormation
A secret can be a password, a set of credentials such as a user name and password, ... cannot resolve those references, which...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found