IronLanguages / ironpython2

Implementation of the Python programming language for .NET Framework; built on top of the Dynamic Language Runtime (DLR).
http://ironpython.net
Apache License 2.0
1.07k stars 229 forks source link

pip install requests fails in German locale on 2.7.5 #82

Closed slide closed 6 years ago

slide commented 7 years ago

From @swn1 on September 20, 2016 19:55

Running stock 2.7.5 on windows 7 or 10 (at least), installing the requests package with pip fails in the German locale. I think it fails in Japanese, too, but I'm a lot more able to stumble through the UI in German.

Installing works fine in US English and the package, once installed, works fine in German. The problem seems to have to do with parsing SSL certificate fields but that could be a canard.

C:\Program Files (x86)\IronPython 2.7>ipy -X:Frames -m pip install requests
Downloading/unpacking requests
C:\Program Files (x86)\IronPython 2.7\lib\site-packages\pip\_vendor\requests\pac
kages\urllib3\connectionpool.py:1: DeprecationWarning: object.__new__() takes no
 parameters
  # urllib3/connectionpool.py
Cleaning up...
Exception:
Traceback (most recent call last):
  File "C:\Program Files (x86)\IronPython 2.7\lib\site-packages\pip\basecommand.
py", line 122, in main
    status = self.run(options, args)
  File "C:\Program Files (x86)\IronPython 2.7\lib\site-packages\pip\commands\ins
tall.py", line 278, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundl
e=self.bundle)
  File "C:\Program Files (x86)\IronPython 2.7\lib\site-packages\pip\req.py", lin
e 1183, in prepare_files
    url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
  File "C:\Program Files (x86)\IronPython 2.7\lib\site-packages\pip\index.py", l
ine 194, in find_requirement
    page = self._get_page(main_index_url, req)
  File "C:\Program Files (x86)\IronPython 2.7\lib\site-packages\pip\index.py", l
ine 566, in _get_page
    return HTMLPage.get_page(link, req,
  File "C:\Program Files (x86)\IronPython 2.7\lib\site-packages\pip\index.py", l
ine 670, in get_page
    resp = session.get(url, headers={"Accept": "text/html"})
  File "C:\Program Files (x86)\IronPython 2.7\lib\site-packages\pip\_vendor\requ
ests\sessions.py", line 468, in get
    return self.request('GET', url, **kwargs)
  File "C:\Program Files (x86)\IronPython 2.7\lib\site-packages\pip\download.py"
, line 237, in request
    return super(PipSession, self).request(method, url, *args, **kwargs)
  File "C:\Program Files (x86)\IronPython 2.7\lib\site-packages\pip\_vendor\requ
ests\sessions.py", line 456, in request
    resp = self.send(prep, **send_kwargs)
  File "C:\Program Files (x86)\IronPython 2.7\lib\site-packages\pip\_vendor\requ
ests\sessions.py", line 559, in send
    r = adapter.send(request, **kwargs)
  File "C:\Program Files (x86)\IronPython 2.7\lib\site-packages\pip\_vendor\requ
ests\adapters.py", line 317, in send
    resp = conn.urlopen(
  File "C:\Program Files (x86)\IronPython 2.7\lib\site-packages\pip\_vendor\requ
ests\packages\urllib3\connectionpool.py", line 491, in urlopen
    httplib_response = self._make_request(conn, method, url,
  File "C:\Program Files (x86)\IronPython 2.7\lib\site-packages\pip\_vendor\requ
ests\packages\urllib3\connectionpool.py", line 291, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "C:\Program Files (x86)\IronPython 2.7\Lib\httplib.py", line 955, in requ
est
    self._send_request(method, url, body, headers)
  File "C:\Program Files (x86)\IronPython 2.7\Lib\httplib.py", line 989, in _sen
d_request
    self.endheaders(body)
  File "C:\Program Files (x86)\IronPython 2.7\Lib\httplib.py", line 951, in endh
eaders
    self._send_output(message_body)
  File "C:\Program Files (x86)\IronPython 2.7\Lib\httplib.py", line 811, in _sen
d_output
    self.send(msg)
  File "C:\Program Files (x86)\IronPython 2.7\Lib\httplib.py", line 773, in send

    self.connect()
  File "C:\Program Files (x86)\IronPython 2.7\lib\site-packages\pip\_vendor\requ
ests\packages\urllib3\connection.py", line 197, in connect
    match_hostname(self.sock.getpeercert(),
  File "C:\Program Files (x86)\IronPython 2.7\lib\site-packages\pip\_vendor\requ
ests\packages\urllib3\packages\ssl_match_hostname\_implementation.py", line 88,
in match_hostname
    for key, value in sub:
ValueError: too many values to unpack

Copied from original issue: IronLanguages/main#1424

slide commented 7 years ago

From @simplicbe on September 20, 2016 20:20

Thanks for reporting the issue. We'll take a look at it. Would you like to format your issue using:

 your code goes here
slide commented 7 years ago

From @swn1 on September 21, 2016 13:17

Updated with tripple-tick notation. Thanks for the tip.

The context if, I've got a large application that is invoking pip in ipy.exe via the subprocess package in an embedded IP intepreter. I'm hoping I can work around this by forcing the subprocess locale to us-english but I've not found the trick for that yet.

slide commented 6 years ago

This looks like a duplicate of #57