DataDog / datadogpy

The Datadog Python library
https://datadoghq.com/
Other
609 stars 303 forks source link

Dogshell broken on Python 3.11 #746

Closed allen-stubberud closed 1 year ago

allen-stubberud commented 1 year ago

Describe the bug argparse logic is broken on Python 3.11. Setting up the argument parser throws an exception before any arguments can be parsed. This issue in an unrelated project might be relevant.

To Reproduce Steps to reproduce the behavior:

  1. Invoke dogshell on the command line: # dog

Expected behavior The command line parser does not crash.

Screenshots

# dog
Traceback (most recent call last):
  File "/usr/local/bin/dog", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/local/lib/python3.11/site-packages/datadog/dogshell/__init__.py", line 96, in main
    DashboardListClient.setup_parser(subparsers)
  File "/usr/local/lib/python3.11/site-packages/datadog/dogshell/dashboard_list.py", line 128, in setup_parser
    delete_dashboards_v2_parser = verb_parsers.add_parser(
                                  ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/argparse.py", line 1185, in add_parser
    raise ArgumentError(self, _('conflicting subparser: %s') % name)
argparse.ArgumentError: argument verb: conflicting subparser: delete_dashboards

Environment and Versions (please complete the following information): Python 3.11 (Alpine Linux) Datadogpy 777377105f2aaaaeb6ddd98abb4c90815c95589c

github-actions[bot] commented 1 year ago

Thanks for your contribution!

This issue has been automatically marked as stale because it has not had activity in the last 30 days. Note that the issue will not be automatically closed, but this notification will remind us to investigate why there's been inactivity. Thank you for participating in the Datadog open source community.

If you would like this issue to remain open:

  1. Verify that you can still reproduce the issue in the latest version of this project.

  2. Comment that the issue is still reproducible and include updated details requested in the issue template.

latch-danielkneip commented 1 year ago

This is still an issue.