Skip to content

Python 3.10.4 and Python-3.10.8 (and possibly others) come with a broken PyCrypto #17410

@surak

Description

@surak
module load Python/3.10.4
python

Python 3.10.4 (main, Sep 29 2022, 19:35:58) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from Crypto.PublicKey import RSA
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/p/software/jurecadc/stages/2023/software/Python/3.10.4-GCCcore-11.3.0/lib/python3.10/site-packages/Crypto/PublicKey/RSA.py", line 585
    except ValueError, IndexError:
           ^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: multiple exception types must be parenthesized

This is caused by the broken PyCrypto python module, which is by the way abandonware: pycrypto/pycrypto#327

I propose this fix:

diff --git a/easybuild/easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0.eb b/easybuild/easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0.eb
index 1cfac838d2..a2bcf32f50 100644
--- a/easybuild/easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0.eb
+++ b/easybuild/easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0.eb
@@ -99,14 +99,9 @@ exts_list = [
         'modulename': 'arff',
         'checksums': ['3220d0af6487c5aa71b47579be7ad1d94f3849ff1e224af3bf05ad49a0b5c4da'],
     }),
-    ('pycrypto', '2.6.1', {
+    ('pycryptodome', '3.17', {
         'modulename': 'Crypto',
-        'patches': ['pycrypto-2.6.1_remove-usr-include.patch'],
-        'checksums': [
-            'f2ce1e989b272cfcb677616763e0a2e7ec659effa67a88aa92b3a65528f60a3c',  # pycrypto-2.6.1.tar.gz
-            # pycrypto-2.6.1_remove-usr-include.patch
-            '06c3d3bb290305e1360a023ea03f9281116c230de62382e6be9474996086712e',
-        ],
+        'checksums': ['bce2e2d8e82fcf972005652371a3e8731956a0c1fbb719cc897943b3695ad91b'],
     }),
     ('ecdsa', '0.17.0', {
         'checksums': ['b9f500bb439e4153d0330610f5d26baaf18d17b8ced1bc54410d189385ea68aa'],

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions