B2_Command_Line_Tool icon indicating copy to clipboard operation
B2_Command_Line_Tool copied to clipboard

argparse.ArgumentError when running on Python 3.11

Open Uninen opened this issue 1 year ago • 1 comments

Running b2 authorize-account under Python 3.11.0 fails w/ following traceback:

Traceback (most recent call last):
  File "/proj/venv311/bin/b2", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/proj/venv311/lib/python3.11/site-packages/b2/console_tool.py", line 2986, in main
    exit_status = ct.run_command(sys.argv)
                  ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/proj/venv311/lib/python3.11/site-packages/b2/console_tool.py", line 2812, in run_command
    args = B2.get_parser().parse_args(argv[1:])
           ^^^^^^^^^^^^^^^
  File "/proj/venv311/lib/python3.11/site-packages/b2/console_tool.py", line 551, in get_parser
    subcommand.get_parser(subparsers=subparsers, parents=parents, for_docs=for_docs)
  File "/proj/venv311/lib/python3.11/site-packages/b2/console_tool.py", line 527, in get_parser
    parser = subparsers.add_parser(
             ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/uninen/.pyenv/versions/3.11.0/lib/python3.11/argparse.py", line 1185, in add_parser
    raise ArgumentError(self, _('conflicting subparser: %s') % name)
argparse.ArgumentError: argument command: conflicting subparser: authorize-account

When switching back to 3.10 it works fine.

Uninen avatar Oct 28 '22 03:10 Uninen

Ok I know what this is about now but I don't know how to fix it yet. Should have a fix in a few days - please use 3.10 for now.

ppolewicz avatar Nov 01 '22 19:11 ppolewicz

Any news on this?

Uninen avatar Jan 12 '23 17:01 Uninen

Sounds like https://github.com/Backblaze/B2_Command_Line_Tool/pull/835 fixed this, but latest release was last September. New release pretty please? 😃

nicktimko avatar Jan 23 '23 04:01 nicktimko

b2-sdk-python had a longer-than-usual review queue which is down to one PR now. As soon as we release b2sdk, we'll merge in the branches and release the cli.

ppolewicz avatar Jan 23 '23 12:01 ppolewicz

Fixed with the release of https://github.com/Backblaze/B2_Command_Line_Tool/releases/tag/v3.7.0

ppolewicz avatar Feb 19 '23 18:02 ppolewicz