I am using the cryptography package and inapppy in a project. https://cryptography.io/en/latest/changelog/#v44-0-0 has caused this error, I believe this is due to the dependency on oauth2lib which hasn't been updated since 2018
Stack trace:
...my code...
File "/usr/local/lib/python3.12/site-packages/inapppy/googleplay.py", line 210, in verify_with_result
result = self.check_purchase_subscription(purchase_token, product_sku, service)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/inapppy/googleplay.py", line 157, in check_purchase_subscription
result = subscriptions_get.execute(http=self.http)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/googleapiclient/_helpers.py", line 130, in positional_wrapper
return wrapped(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/googleapiclient/http.py", line 923, in execute
resp, content = _retry_request(
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/googleapiclient/http.py", line 191, in _retry_request
resp, content = http.request(uri, method, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/oauth2client/transport.py", line 159, in new_request
credentials._refresh(orig_request_method)
File "/usr/local/lib/python3.12/site-packages/oauth2client/client.py", line 749, in _refresh
self._do_refresh_request(http)
File "/usr/local/lib/python3.12/site-packages/oauth2client/client.py", line 774, in _do_refresh_request
body = self._generate_refresh_request_body()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/oauth2client/client.py", line 1484, in _generate_refresh_request_body
assertion = self._generate_assertion()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/oauth2client/service_account.py", line 384, in _generate_assertion
return crypt.make_signed_jwt(self._signer, payload,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/oauth2client/crypt.py", line 97, in make_signed_jwt
signature = signer.sign(signing_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/oauth2client/_openssl_crypt.py", line 97, in sign
return crypto.sign(self._key, message, 'sha256')
^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/cryptography/utils.py", line 68, in __getattr__
obj = getattr(self._module, attr)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'OpenSSL.crypto' has no attribute 'sign'
I am using the cryptography package and inapppy in a project. https://cryptography.io/en/latest/changelog/#v44-0-0 has caused this error, I believe this is due to the dependency on
oauth2lib
which hasn't been updated since 2018Stack trace:
Possible Fix
Freeze the cryptography package at 43.0.3