internetarchive / warcprox

WARC writing MITM HTTP/S proxy
371 stars 54 forks source link

AttributeError: 'Backend' object has no attribute 'activate_builtin_random' #196

Open bjorn3 opened 7 months ago

bjorn3 commented 7 months ago
Traceback (most recent call last):
  File "/home/bjorn/Documenten/crawler/.env/bin/warcprox", line 33, in <module>
    sys.exit(load_entry_point('warcprox==2.4.17', 'console_scripts', 'warcprox')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bjorn/Documenten/crawler/.env/lib/python3.11/site-packages/warcprox/main.py", line 316, in main
    cryptography.hazmat.backends.openssl.backend.activate_builtin_random()
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Backend' object has no attribute 'activate_builtin_random'

This method was dropped in https://github.com/pyca/cryptography/commit/5e6476a4c6e094926a983dcf5cbe9488c30aeb53 which was released in cryptography 41.0.0.

FHantke commented 7 months ago

Do you have any workaround for the moment?

FHantke commented 7 months ago

Seems to work with the current version: pip install git+https://github.com/internetarchive/warcprox.git

bjorn3 commented 7 months ago

The workaround I did was to force cryptography version 40 to be used.

tabbyrobin commented 4 months ago

Might it be possible to push an updated package to pypi, with a patch version bump, with a specific requirement cryptography<=40.0.2 (or similar)? Right now pip/pipx install warcprox is broken, without the extra step of e.g. pipx inject warcprox 'cryptography<41' etc.