pyroma: Checking packages from PyPI appears to be broken

When attempting to check any package on PyPI with latest Pyroma (3.0.2), on both Windows and Linux on Python 3.7.x, an error results:

xmlrpc.client.Fault: <Fault -32500: 'HTTPTooManyRequests: The action could not be performed because there were too many requests by the client. Limit may reset in 1 seconds.'>

I’ve tested numerous times over the period of a day, with no luck. If I were to guess, this may be due to the domain and API changes involved in the transition to Warehouse/pypi.org from the old Cheeseshop/packages.pypi.org

$ pyroma -p black
------------------------------
Checking black
Found black version 20.8b1
Traceback (most recent call last):
  File "C:\Miniconda3\envs\cf-env\Scripts\pyroma-script.py", line 33, in <module>
    sys.exit(load_entry_point('pyroma', 'console_scripts', 'pyroma')())
  File "c:\users\c. a. m. gerlach\documents\dev\hypertool\pyroma\pyroma\__init__.py", line 101, in main
    rating = run(mode, argument)
  File "c:\users\c. a. m. gerlach\documents\dev\hypertool\pyroma\pyroma\__init__.py", line 120, in run
    data = pypidata.get_data(argument)
  File "c:\users\c. a. m. gerlach\documents\dev\hypertool\pyroma\pyroma\pypidata.py", line 37, in get_data
    data = client.release_data(project, release)
  File "C:\Miniconda3\envs\cf-env\lib\xmlrpc\client.py", line 1112, in __call__
    return self.__send(self.__name, args)
  File "C:\Miniconda3\envs\cf-env\lib\xmlrpc\client.py", line 1452, in __request
    verbose=self.__verbose
  File "C:\Miniconda3\envs\cf-env\lib\xmlrpc\client.py", line 1154, in request
    return self.single_request(host, handler, request_body, verbose)
  File "C:\Miniconda3\envs\cf-env\lib\xmlrpc\client.py", line 1170, in single_request
    return self.parse_response(resp)
  File "C:\Miniconda3\envs\cf-env\lib\xmlrpc\client.py", line 1342, in parse_response
    return u.close()
  File "C:\Miniconda3\envs\cf-env\lib\xmlrpc\client.py", line 656, in close
    raise Fault(**self._stack[0])
xmlrpc.client.Fault: <Fault -32500: 'HTTPTooManyRequests: The action could not be performed because there were too many requests by the client. Limit may reset in 1 seconds.'>

In addition, a ResourcesWarning is generated due to the XMLRPC client not being opened in a context manager, thus leaking an unclosed socket

sys:1: ResourceWarning: unclosed <ssl.SSLSocket fd=592, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('192.168.1.101', 64493), raddr=('151.101.64.223', 443)>

Unless its something simple, if this was due to the PyPI API changes it likely needs a full rewrite. If that’s not feasible to do in the near-term, this feature should presumably be disabled with a friendlier and more informative error message, or removed.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (6 by maintainers)

Most upvoted comments

3.2 released

Yeah, I must have pressed the wrong button, not the first time…