Skip to content

new-api-token: need to use --config; expiration comment in the config not being updated #4149

@brianjmurrell

Description

@brianjmurrell

I'm getting an error trying to use the new new-api-token command:

$ copr new-api-token
Traceback (most recent call last):
  File "/usr/bin/copr", line 33, in <module>
    sys.exit(load_entry_point('copr-cli==2.4', 'console_scripts', 'copr-cli')())
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3.14/site-packages/copr_cli/main.py", line 2061, in main
    getattr(commands, arg.func)(arg)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^
  File "/usr/lib/python3.14/site-packages/copr_cli/main.py", line 305, in action_new_api_token
    if not os.path.exists(args.config):
           ~~~~~~~~~~~~~~^^^^^^^^^^^^^
  File "<frozen genericpath>", line 19, in exists
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType

It seems that args.config is None.

Am I supposed to explicitly set the config using --config for this command, when I don't have to do it for any other command?

$ copr --config ~/.config/copr new-api-token
New API token was updated in /home/brian/.config/copr.

So the token is being updated but the # expiration date: in the config file is not being updated so now I have no idea when my token will expire and will only know when it happens, when I can no longer use the token to refresh itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Needs triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions