m2crypto: python 2.7 compatibility and which versi

2019-07-22 03:08发布

We've been using M2crypto with Python 2.6 for Windows (32-bit) for some time with great success. We used one of the user contributed setups to install M2crypto in our development environments. We would like to move to Python 2.7, but noticed there are no pre-built Python 2.7 setups for m2crypto.

Questions:

  1. Is M2crypto 0.20.2 compatible with Python 2.7 or should we remain at Python 2.6 if we want to continue to use this library?

  2. Does anyone have a user built setup for installing M2Crypto 0.20.2 in a Python 2.7 environment? (There are no 2.7 contributions on the M2crypto site and google comes up empty as well)

  3. Can we copy our Python 2.6 M2Crypto files (under lib\site-packages\M2Crypto) to the same place in our Python 2.7 setup and avoid a formal installation process?

  4. What version of OpenSLL should we use with M2crypto 0.20.2? I checked the OpenSSL website and there appear 2 versions of OpenSSL to choose from: 0.9.8 and 1.0.0a.

Thank you, Malcolm

1条回答
时光不老,我们不散
2楼-- · 2019-07-22 03:38
  1. Yes, it's compatible with Python 2.7, so you can freely upgrade if you have not already.
  2. Yes, here you have bdist_wininst, bdist_egg and bdist for M2Crypto 20.2 built for Python 2.7 with MSVS2008 by me, hope it will fit your needs.
  3. No, you will get import error, as .pyd file (which is actually DLL) has python26.dll in it's import table, so this will not work. Of course, you can hack it and replace python26 with python27, but that's too dirt and gives you no guarantee it will work all the time.
  4. Version I uploaded for you works fine with OpenSSL 0.9.8o, haven't tested it with 1.0.0.
查看更多
登录 后发表回答