#1058026 PyPI’s XML-RPC API is deprecated, causing errors when downloading packages.

Package:
src:stdeb
Source:
src:stdeb
Submitter:
Picca Frédéric-Emmanuel
Date:
2023-12-11 10:39:03 UTC
Severity:
normal
#1058026#5
Date:
2023-12-11 10:37:49 UTC
From:
To:
Hello,

while trying to use pupy-install, I got this error message

/tmp$ pypi-download at
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/stdeb/transport.py", line 62, in request
    resp.raise_for_status()
  File "/usr/lib/python3/dist-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://pypi.org//RPC2

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/pypi-download", line 35, in <module>
    main()
  File "/usr/bin/pypi-download", line 27, in main
    tarball_fname = get_source_tarball(
                    ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/stdeb/downloader.py", line 109, in get_source_tarball
    download_url, expected_md5_digest = find_tar_gz(package_name,
                                        ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/stdeb/downloader.py", line 39, in find_tar_gz
    all_releases = _call(pypi.package_releases, package_name, show_hidden)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/stdeb/downloader.py", line 89, in _call
    return callable_(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/xmlrpc/client.py", line 1122, in __call__
    return self.__send(self.__name, args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/xmlrpc/client.py", line 1464, in __request
    response = self.__transport.request(
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/stdeb/transport.py", line 64, in request
    raise xmlrpc.ProtocolError(
xmlrpc.client.ProtocolError: <ProtocolError for https://pypi.org//RPC2: 404 404 Client Error: Not Found for url: https://pypi.org//RPC2>


It seems that a patch exist in order to use the json interface instead of the now removed xml-rpc interface.

https://github.com/astraw/stdeb/pull/195

please considere adding this patch to the package.

thanks

Frederic