On Windows 10, using Python 3.4, cheroot 5.1 import cheroot.ssl.pyopenssl fails:
(wsgidav34) C:\Prj\git\wsgidav>pip list
cheroot (5.1.0)
defusedxml (0.5.0)
pip (9.0.1)
portend (1.8)
pypiwin32 (219)
pytz (2016.10)
setuptools (18.2)
six (1.10.0)
tempora (1.6.1)
WsgiDAV (2.1.1.dev20170218, c:\prj\git\wsgidav)
(wsgidav34) C:\Prj\git\wsgidav>python
Python 3.4.4 (v3.4.4:737efcadf5a6, Dec 20 2015, 19:28:18) [MSC v.1600 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import cheroot
>>> import cheroot.ssl.pyopenssl
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\prj\env\wsgidav34\lib\site-packages\cheroot\ssl\pyopenssl.py", line 49, in <module>
class SSL_fileobject(MakeFile):
TypeError: function() argument 1 must be code, not str
>>>
It looks like the problem is in makefile.py, where a function object is assigned to MakeFile
def MakeFile_PY3(sock, mode='r', bufsize=io.DEFAULT_BUFFER_SIZE):
if 'r' in mode:
return io.BufferedReader(socket.SocketIO(sock, mode), bufsize)
else:
return BufferedWriter(socket.SocketIO(sock, mode), bufsize)
[...]
MakeFile = MakeFile_PY2 if six.PY2 else MakeFile_PY3
and then in pyopenssl.py this function is used as a base class?
from ..makefile import MakeFile
class SSL_fileobject(MakeFile):
[...]
On Windows 10, using Python 3.4, cheroot 5.1
import cheroot.ssl.pyopensslfails:It looks like the problem is in
makefile.py, where a function object is assigned toMakeFileand then in
pyopenssl.pythis function is used as a base class?