Title: Failure in urllib3 using versions of pip after pip 9.0.1
Type: crash Severity: normal
Components: Library Versions: Jython 2.7
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: frenzy, jaraco, jeff.allen, stefan.richthofer
Priority: normal Keywords:

Created on 2018-03-28.16:00:42 by jeff.allen, last changed 2018-07-06.03:17:46 by jaraco.

msg11860 (view) Author: Jeff Allen (jeff.allen) Date: 2018-03-28.16:00:40
See for environment, console session and a stack dump. Briefly:

# Upgrade to 9.0.3
[root@b5718b55e70d /]# jython -m pip install --upgrade pip
Collecting pip
  Downloading pip-9.0.3-py2.py3-none-any.whl (1.4MB)
    100% |████████████████████████████████| 1.4MB 379kB/s 
Installing collected packages: pip
  Found existing installation: pip 9.0.1
    Uninstalling pip-9.0.1:
      Successfully uninstalled pip-9.0.1
Successfully installed pip-9.0.3

# Install pytest
[root@b5718b55e70d /]# jython -m pip install pytest
Collecting pytest
Traceback (most recent call last):
  File "/usr/share/jython/Lib/site-packages/pip/", line 215, in main
    status =, args)
  File "/usr/share/jython/Lib/site-packages/pip/_vendor/urllib3/util/", line 344, in register
    key = super(PollSelector, self).register(fileobj, events, data)
  File "/usr/share/jython/Lib/site-packages/pip/_vendor/urllib3/util/", line 197, in register
    key = SelectorKey(fileobj, self._fileobj_lookup(fileobj), events, data)
  File "/usr/share/jython/Lib/site-packages/pip/_vendor/urllib3/util/", line 181, in _fileobj_lookup
    return _fileobj_to_fd(fileobj)
  File "/usr/share/jython/Lib/site-packages/pip/_vendor/urllib3/util/", line 50, in _fileobj_to_fd
    raise ValueError("Invalid file object: {0!r}".format(fileobj))
ValueError: Invalid file object: <ssl.SSLSocket object at 0x1a4>
msg11865 (view) Author: Stefan Richthofer (stefan.richthofer) Date: 2018-04-01.15:00:23
It would be nice if we had a minimal code snippet that reproduced this issue solely involving urllib3, i.e. independently from pip.
msg11870 (view) Author: Lumír Balhar (frenzy) Date: 2018-04-03.11:35:16
I cannot reproduce this problem with requests which uses urllib3. However, I can reproduce original issue with pip 9.0.3.
Date User Action Args
2018-07-06 03:17:46jaracosetnosy: + jaraco
2018-04-03 11:35:17frenzysetnosy: + frenzy
messages: + msg11870
2018-04-01 15:00:23stefan.richthofersetnosy: + stefan.richthofer
messages: + msg11865
2018-03-28 16:08:18jeff.allensettitle: Failure in urllib3 using versions after pip 9.0.1 -> Failure in urllib3 using versions of pip after pip 9.0.1
2018-03-28 16:00:42jeff.allencreate