Cannot import cheroot.ssl.pyopenssl
See original GitHub issueOn 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):
[...]
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
cheroot.ssl.pyopenssl module
A library for integrating pyOpenSSL with Cheroot. The OpenSSL module must be importable for SSL/TLS/HTTPS functionality. You can obtain it from here.
Read more >Both builtin and pyopensssl doesn't work with cherrypy
Yes! I had the same problem serving images and found the answer here: https://github.com/cherrypy/cheroot/issues/245.
Read more >SSL without installing pyOpenSSL with custom scripts ?
cant access internet do download pyOpenSSL after running command as ... But HUE still cant recognize that it's installed: ... from OpenSSL import...
Read more >python2-pyopenssl - AUR (en) - Arch Linux
_openssl import ffi, lib INTERNALERROR> ImportError: /usr/lib/python2.7/site-packages/cryptography/hazmat/bindings/_openssl.so: undefined ...
Read more >CherryPy Documentation - Read the Docs
ssl – for OpenSSL bindings, useful in Python environments not having the ... (by creating a module and importing classes from cheroot).
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi Sviatoslav it is not hi prio on my list either, but I will take a note and may be help out sometime later…
The initial problem of not being able to import has been solved. Closing in favor of #113, which is more about fixing the adapter itself now.