1 setup.py for Python 3 doesn't invoke 2to3 on pct-speedtest.py, which runs
4 Traceback (most recent call last):
5 File "pct-speedtest.py", line 218, in <module>
7 File "pct-speedtest.py", line 200, in run
8 self.test_pubkey_setup(pubkey_name, module, key_bytes)
9 File "pct-speedtest.py", line 85, in test_pubkey_setup
10 keys = self.random_keys(key_bytes)[:5]
11 File "pct-speedtest.py", line 49, in random_keys
12 return self.random_blocks(bytes, 10**5) # 100k
13 File "pct-speedtest.py", line 53, in random_blocks
14 data = self.random_data(bytes)
15 File "pct-speedtest.py", line 62, in random_data
16 self.__random_data = self._random_bytes(bytes)
17 File "pct-speedtest.py", line 73, in _random_bytes
19 File "/usr/lib64/python3.2/os.py", line 777, in urandom
20 bs += read(_urandomfd, n - len(bs))
21 TypeError: integer argument expected, got float
23 This is due to the divisions in the pubkey_specs table, which in Python 3 is
24 true division, returning a float.
26 As it happens, 2to3 can't convert these divisions, see:
27 http://bugs.python.org/issue12831
29 Change them to explicitly be floor divisions (supported in Python 2.2
30 onwards; see PEP 0238)
32 --- pycrypto/pct-speedtest.py
33 +++ pycrypto/pct-speedtest.py
38 - ("RSA(1024)", RSA, 1024/8),
39 - ("RSA(2048)", RSA, 2048/8),
40 - ("RSA(4096)", RSA, 4096/8),
41 + ("RSA(1024)", RSA, 1024//8),
42 + ("RSA(2048)", RSA, 2048//8),
43 + ("RSA(4096)", RSA, 4096//8),