Closed madonius closed 6 years ago
It looks like the data returned from the xmlrpc server is malformed or it's a pypi issue.
try:
import xmlrpclib
except ImportError:
import xmlrpc.client as xmlrpclib
import pprint
client = xmlrpclib.ServerProxy('https://pypi.python.org/pypi')
client.search({'name': 'pam'})
Will also raise an exception.
And that's the debug output:
(Constucted with client = xmlrpclib.ServerProxy('https://pypi.python.org/pypi', None, None, True)
)
send: b'POST /pypi HTTP/1.1\r\nHost: pypi.python.org\r\nAccept-Encoding: gzip\r\nContent-Type: text/xml\r\nUser-Agent: Python-xmlrpc/3.6\r\nContent-Length: 224\r\n\r\n'
send: b"<?xml version='1.0'?>\n<methodCall>\n<methodName>search</methodName>\n<params>\n<param>\n<value><struct>\n<member>\n<name>name</name>\n<value><string>pam</string></value>\n</member>\n</struct></value>\n</param>\n</params>\n</methodCall>\n"
reply: 'HTTP/1.1 200 OK\r\n'
header: Content-Encoding header: Content-Security-Policy header: Content-Type header: ETag header: Referrer-Policy header: Server header: Content-Length header: Accept-Ranges header: Date header: Connection header: X-Served-By header: X-Cache header: X-Cache-Hits header: X-Timer header: Vary header: Strict-Transport-Security header: X-Frame-Options header: X-XSS-Protection header: X-Content-Type-Options header: X-Permitted-Cross-Domain-Policies body: b"<?xml version='1.0'?>\n<methodResponse>\n<fault>\n<value><struct>\n<member>\n<name>faultCode</name>\n<value><int>-32500</int></value>\n</member>\n<member>\n<name>faultString</name>\n<value><string>application error</string></value>\n</member>\n</struct></value>\n</fault>\n</methodResponse>\n"
If you think it's a PyPI issue, feel free to file an issue at pypa/warehouse. :)
The pam
package has an empty (null) summary (cf. http --pretty all --follow -v GET https://pypi.org/pypi/pam/json | less -R
), which is uncommon and might cause this. And it is definitely server-side, the Fault
response is in answer to the XMLRPC request.
In the PyPI server logs, there'll be a line with xml-rpc exception "…"
, showing the real (internal) exception causing the fault response (the "application" in the error is referring to the XMLRPC server implementation).
Thanks for looking into this @jhermann! I've filed pypa/warehouse#4074 for this.
I'll close this issue. :)
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Environment
Description
Same behaviour can be observed with pip3
Expected behavior
To get a list of packages containing
pam
in their name or description. Similar to the PyPi searchHow to Reproduce
get-pip.py
scriptOutput