aliyun / aliyun/aliyun-openapi-python-sdk

Cannot import 'aliyunsdkcore.client' on Python 3.13.0a3

Open
#525 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1k
Forks
578
PR merge metrics
No merged PRs in 30d

Description

  • Python Version: Python 3.13.0a3

  • aliyunsdkcore Version: 2.14.0

  • API: client

On Python 3.13 Alpha 3, we are unable to import 'aliyunsdkcore.client':

$ pip3 install aliyun-python-sdk-core
Collecting aliyun-python-sdk-core
  Using cached aliyun_python_sdk_core-2.14.0-py3-none-any.whl
Collecting jmespath<1.0.0,>=0.9.3 (from aliyun-python-sdk-core)
  Using cached jmespath-0.10.0-py2.py3-none-any.whl (24 kB)
Collecting cryptography>=2.6.0 (from aliyun-python-sdk-core)
  Obtaining dependency information for cryptography>=2.6.0 from https://files.pythonhosted.org/packages/3c/72/fb557573cebcae88c6efe3a73981181384e08408c1125a8e97a7fb3edde4/cryptography-42.0.2-cp39-abi3-manylinux_2_28_x86_64.whl.metadata
  Using cached cryptography-42.0.2-cp39-abi3-manylinux_2_28_x86_64.whl.metadata (5.3 kB)
Collecting cffi>=1.12 (from cryptography>=2.6.0->aliyun-python-sdk-core)
  Using cached cffi-1.16.0-cp313-cp313-linux_x86_64.whl
Collecting pycparser (from cffi>=1.12->cryptography>=2.6.0->aliyun-python-sdk-core)
  Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Using cached cryptography-42.0.2-cp39-abi3-manylinux_2_28_x86_64.whl (4.7 MB)
Installing collected packages: pycparser, jmespath, cffi, cryptography, aliyun-python-sdk-core
Successfully installed aliyun-python-sdk-core-2.14.0 cffi-1.16.0 cryptography-42.0.2 jmespath-0.10.0 pycparser-2.21

[notice] A new release of pip is available: 23.2.1 -> 24.0
[notice] To update, run: pip install --upgrade pip
$ python -c "import aliyunsdkcore.client"
ImportError: /tmp/venv-python3.13/lib64/python3.13/site-packages/_cffi_backend.cpython-313-x86_64-linux-gnu.so: undefined symbol: _PyErr_WriteUnraisableMsg
thread '<unnamed>' panicked at /github/home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pyo3-0.20.2/src/err/mod.rs:788:5:
Python API call failed
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Traceback (most recent call last):
  File "<string>", line 1, in <module>
    import aliyunsdkcore.client
  File "/tmp/venv-python3.13/lib64/python3.13/site-packages/aliyunsdkcore/client.py", line 40, in <module>
    from aliyunsdkcore.auth.signers.signer_factory import SignerFactory
  File "/tmp/venv-python3.13/lib64/python3.13/site-packages/aliyunsdkcore/auth/signers/signer_factory.py", line 13, in <module>
    from aliyunsdkcore.auth.signers import rsa_key_pair_signer
  File "/tmp/venv-python3.13/lib64/python3.13/site-packages/aliyunsdkcore/auth/signers/rsa_key_pair_signer.py", line 12, in <module>
    from aliyunsdkcore.auth.algorithm import sha_hmac256
  File "/tmp/venv-python3.13/lib64/python3.13/site-packages/aliyunsdkcore/auth/algorithm/sha_hmac256.py", line 21, in <module>
    from cryptography.hazmat.primitives import hashes
  File "/tmp/venv-python3.13/lib64/python3.13/site-packages/cryptography/hazmat/primitives/hashes.py", line 9, in <module>
    from cryptography.hazmat.bindings._rust import openssl as rust_openssl
pyo3_runtime.PanicException: Python API call failed
$ python --version
Python 3.13.0a3
$ python
Python 3.13.0a3 (main, Jan 18 2024, 00:00:00) [GCC 13.2.1 20231205 (Red Hat 13.2.1-6)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import aliyunsdkcore
>>> print(aliyunsdkcore.__version__)
2.14.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the reported import with Python 3.13.0a3 and aliyun-python-sdk-core 2.14.0, then trace the failure through aliyunsdkcore/client.py, signer_factory.py, rsa_key_pair_signer.py, and sha_hmac256.py into cryptography. Determine whether the compatibility fix belongs in this SDK or its dependency; done means the documented import completes successfully on the affected Python version.

Written by the indexing model from the issue text.

Assessment

Tech stack
cryptography, python
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.