[pycrypto] Once again: Python3 with PyCrypto

Dwayne C. Litzenberger dlitz at dlitz.net
Mon Dec 27 07:37:40 CST 2010

Wow, it looks like you're really moving things along.  Thanks, Thorsten!

"Thorsten Behrens" <sbehrens at gmx.li> wrote:

>Quick update on where this stands right now.
>As predicted, the module handling changes with Python 3.x were a pain.
>think I have them under control now. At least "python setup.py test" no
>longer crashes immediately. It now gets far enough to complain about 
>bytes/unicode errors.
>I haven't attempted _fastmath.c on Python 3.x yet. I'll do that last, 
>when everything else works.
>C modules will give link-time errors, like so: "_counter.obj : warning 
>LNK4197: export 'init_counter' specified multiple times; using first 
>specification". This is an issue in distutils. See python issue 9709. 
>There's nothing we can do until Python fixes distutils - of course any 
>pre-compiled binaries can be built with the distutils fix in, and the 
>README can warn people of this.
>The code still works with Python27, but I broke Python21. Specifically,
>I am having a hard time with string literals. The main work remaining 
>now is to flush out string to bytes/unicode changes between 2.x and
>and adapt the code. I thought I had this licked, but I clearly don't.
>I am currently not handling literals well. This is what I tried:
>         if sys.version_info[0] is 2:
>             seed = "".join(seed)
>         else:
>             seed = b"".join(seed)
>And that gives a "SyntaxError: invalid syntax" at run time. Of course
>django has been moved to be 2.x/3.x compatible. I'll see what they did 
>and try to replicate it. I'm hoping it'll take care of these type of
>Assignment to True and False in pycrypto_compat.py is an issue. Right 
>now, I just don't import pycrypto_compat.py when Python 3.x is
>That still gives install-time errors on Python 3.x. The only option I 
>can think of right now is to exclude the offending file from install in
>setup.py if Python 3.x is detected.
>pycrypto mailing list
>pycrypto at lists.dlitz.net

Sent from my Android phone with K-9 Mail. Please excuse my brevity.

More information about the pycrypto mailing list