Working on Debian 7.11 for RPI, I came across this bug with pip-3.2.
I tracked it down to the dowload.py module from pip that instantiate an HTTP 
transport by default.

Later on, this default transport will make it to the client, which will
inspect the URL to determine what type of transport to allocate, but
since one is already passed down, it will not reallocate it. So one
workaround here is to add "transport=None" just before the check to
force it to reallocate it.

Another work around could be to allocate a SafeTransport by default
(that's how I fix my system ).

In the first workaround, it's required to also update the default URL in

/usr/lib/python3/dist-packages/pip/commands/search.py

from "http://..."; to "https://...";

===============

/usr/lib/python3/dist-packages/pip/download.py

---> xmlrpclib_transport = xmlrpclib.SafeTransport()

/usr/lib/python3.2/xmlrpc/client.py

    def __init__(self, uri, transport=None, encoding=None, verbose=False,
                 allow_none=False, use_datetime=False):
        # establish a "logical" server connection                               
                                                                                
                                                                                
                                                                                
                                                                                
                          

        # get the url                                                           
                                                                                
                                                                                
                                                                                
                                                                                
                          
--->        transport=None                                                      
                                                                                
                                                                                
                                                                                
                                                                                
                             
        print("2>",uri)
        import urllib.parse
        type, uri = urllib.parse.splittype(uri)
        print("1>",uri,type)
        if type not in ("http", "https"):
            raise IOError("unsupported XML-RPC protocol")
        self.__host, self.__handler = urllib.parse.splithost(uri)
        if not self.__handler:
            self.__handler = "/RPC2"

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1643164

Title:
  ProtocolError: <ProtocolError for pypi.python.org/pypi: 403 Must
  access using HTTPS instead of HTTP>

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1643164/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to