Python 3.9 throws AttributeError: module 'time' has no attribute 'clock'
karate opened this issue · 2 comments
karate commented
I tried running your script with python 3.9 and got the following Exception while
encrypting the keys:
$ ./megolm_backup.py --from matrix-keys.txt | jq 'map(select(.room_id == "!***:matrix.org"
))' | ./megolm_backup.py --into > new-matrix-keys.txt
Backup passphrase [mode=decrypt]:
Backup passphrase [mode=encrypt]:
Traceback (most recent call last):
File "/home/**/Documents/matrix-utils/./megolm_backup.py", line 170, in <module>
main(sys.argv[1:])
File "/home/**/Documents/matrix-utils/./megolm_backup.py", line 163, in main
output = action(passphrase, data)
File "/home/**/Documents/matrix-utils/./megolm_backup.py", line 75, in enc_session_data
version, S, IV, N = b"\x01", get_random_bytes(16), get_random_bytes(16), 500000
File "/home/**/Documents/matrix-utils/venv/lib/python3.9/site-packages/Crypto/Random/__init__.py", line
41, in get_random_bytes
return _UserFriendlyRNG.get_random_bytes(n)
File "/home/**/Documents/matrix-utils/venv/lib/python3.9/site-packages/Crypto/Random/_UserFriendlyRNG.py
", line 228, in get_random_bytes
return _get_singleton().read(n)
File "/home/**/Documents/matrix-utils/venv/lib/python3.9/site-packages/Crypto/Random/_UserFriendlyRNG.py
", line 178, in read
return _UserFriendlyRNG.read(self, bytes)
File "/home/**/Documents/matrix-utils/venv/lib/python3.9/site-packages/Crypto/Random/_UserFriendlyRNG.py
", line 129, in read
self._ec.collect()
File "/home/**/Documents/matrix-utils/venv/lib/python3.9/site-packages/Crypto/Random/_UserFriendlyRNG.py
", line 77, in collect
t = time.clock()
AttributeError: module 'time' has no attribute 'clock'
karate commented
pycrypto
seems abandoned:
https://pypi.org/project/pycrypto/#history