Gandi / gandi.cli

⚠ ARCHIVED - Command line interface to Gandi.net products using the public API
http://cli.gandi.net/
GNU General Public License v3.0
347 stars 62 forks source link

version 1.6 fails to run on Python 3.8 #306

Open axelsimon opened 3 years ago

axelsimon commented 3 years ago

On this machine, where default Python is still 2.7:

$ python --version
Python 2.7.17

$ gandi --version
Gandi CLI 1.6

Copyright: © 2014-2018 Gandi S.A.S.
License: GPL-3

$ gandi api
API version: 3.3.37

On this other machine, where default Python is 3.8:

$ python --version
Python 3.8.5

$ gandi --version
Gandi CLI 1.6

Copyright: © 2014-2018 Gandi S.A.S.
License: GPL-3

$ gandi api
Traceback (most recent call last):
  File "/home/axsimon/.local/lib/python3.8/site-packages/gandi.cli-1.6-py3.8.egg/gandi/cli/core/utils/xmlrpc.py", line 51, in request
    resp.raise_for_status()
  File "/usr/lib/python3.8/site-packages/requests/models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.gandi.net/v5/

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/axsimon/.local/bin/gandi", line 11, in <module>
    load_entry_point('gandi.cli==1.6', 'console_scripts', 'gandi')()
  File "/home/axsimon/.local/lib/python3.8/site-packages/gandi.cli-1.6-py3.8.egg/gandi/cli/__main__.py", line 8, in main
    cli(obj={})
  File "/usr/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/axsimon/.local/lib/python3.8/site-packages/gandi.cli-1.6-py3.8.egg/gandi/cli/core/cli.py", line 163, in invoke
    click.Group.invoke(self, ctx)
  File "/usr/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3.8/site-packages/click/decorators.py", line 73, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/axsimon/.local/lib/python3.8/site-packages/gandi.cli-1.6-py3.8.egg/gandi/cli/commands/root.py", line 38, in api
    result = gandi.api.info()
  File "/home/axsimon/.local/lib/python3.8/site-packages/gandi.cli-1.6-py3.8.egg/gandi/cli/modules/api.py", line 16, in info
    return cls.call('version.info')
  File "/home/axsimon/.local/lib/python3.8/site-packages/gandi.cli-1.6-py3.8.egg/gandi/cli/core/base.py", line 89, in call
    resp = api.request(method, apikey, *args,
  File "/home/axsimon/.local/lib/python3.8/site-packages/gandi.cli-1.6-py3.8.egg/gandi/cli/core/client.py", line 70, in request
    return func(apikey, *args)
  File "/usr/lib64/python3.8/xmlrpc/client.py", line 1109, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib64/python3.8/xmlrpc/client.py", line 1450, in __request
    response = self.__transport.request(
  File "/home/axsimon/.local/lib/python3.8/site-packages/gandi.cli-1.6-py3.8.egg/gandi/cli/core/utils/xmlrpc.py", line 53, in request
    raise xmlrpclib.ProtocolError(url, resp.status_code,
xmlrpc.client.ProtocolError: <ProtocolError for https://api.gandi.net/v5/: 404 404 Client Error: Not Found for url: https://api.gandi.net/v5/>

Looks like it's just down to Python 3.8, but i could easily being missing something else.

grigouze commented 3 years ago

Hello.

Maybe you can try to remove your config.yaml or retry gandi setup ?

deurk commented 3 years ago

Upgraded this morning and do not confirm the issue, seems to be a local problem.

Gandi.cli# python --version
Python 3.8.5

Gandi.cli# gandi --version
Gandi CLI 1.6
Copyright: © 2014-2018 Gandi S.A.S.
License: GPL-3

Gandi.cli# gandi api
API version: 3.3.37
JulienPalard commented 3 years ago

I think this issue can be closed.