Bug 1718332 - python-crypto fails to build with Python 3.8
Summary: python-crypto fails to build with Python 3.8
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-crypto
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Paul Howarth
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON38
TreeView+ depends on / blocked
 
Reported: 2019-06-07 13:35 UTC by Petr Viktorin (pviktori)
Modified: 2019-06-07 17:17 UTC (History)
2 users (show)

Fixed In Version: python-crypto-2.6.1-26.fc31
Clone Of:
Environment:
Last Closed: 2019-06-07 17:17:11 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Petr Viktorin (pviktori) 2019-06-07 13:35:23 UTC
python-crypto fails to build with Python 3.8.0b1.

The function time.clock(), used in Crypto/Random/_UserFriendlyRNG.py, has been removed. It was deprecated since Python 3.3. Use time.perf_counter() or time.process_time() instead, depending on your requirements, to have a well defined behavior. 
More info:
https://docs.python.org/3.8/whatsnew/3.8.html#api-and-feature-removals

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.8/fedora-rawhide-x86_64/00927490-python-crypto/

For all our attempts to build python-crypto with Python 3.8, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.8/package/python-crypto/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.8:
https://copr.fedorainfracloud.org/coprs/g/python/python3.8/

Let us know here if you have any questions.

Comment 1 Paul Howarth 2019-06-07 17:17:11 UTC
I have copied the approach taken in pycryptodome (a fork of pycrypto), dropping the bundled random number generator and replacing it with a thin wrapper to os.urandom. This gets rid of the problematic code.

Fix in pycryptodome:
https://github.com/Legrandin/pycryptodome/commit/afd6328f

There was also some code for Python 2.1 compatibility that Python 3.8 didn't like, so I got rid of that too.


Note You need to log in before you can comment on or make changes to this bug.