Python 3.14 runtime image omits _zstd, so compression.zstd cannot import
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- docker, python
- Lĩnh vực
- build-system, devops
Hướng nghiên cứu
Bắt đầu bằng cách chạy hai lệnh Docker được cung cấp trên mcr.microsoft.com/azure-functions/python:4-python3.14 và xác nhận lỗi import cùng giá trị của MODULE__ZSTD_STATE. Sau đó, lần theo cấu hình build Python và dependency của image để tìm nơi dependency phát triển của Zstandard được chọn. Công việc được xem là hoàn tất khi image chính thức được build lại import compression.zstd thành công và báo rằng module _zstd hiện diện.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Expected Behavior
The official Python 3.14 Azure Functions runtime should include CPython's _zstd extension so that the Python 3.14 standard-library import from compression import zstd succeeds. Python 3.14 is GA for Azure Functions, and CPython documents Zstandard 1.4.5 or later as the build dependency for this optional standard-library module.
Actual Behavior
In the official mcr.microsoft.com/azure-functions/python:4-python3.14 image, importing compression.zstd raises ModuleNotFoundError: No module named '_zstd'. CPython's recorded build state reports MODULE__ZSTD_STATE=missing. The final image contains libzstd.so.1, but the extension was not compiled when CPython was built, so adding the runtime library or installing the third-party zstandard package cannot restore the missing standard-library extension.
Steps to Reproduce
-
Pull the current official image:
docker pull --platform linux/amd64 mcr.microsoft.com/azure-functions/python:4-python3.14 -
Run the standard-library import:
docker run --platform linux/amd64 --rm mcr.microsoft.com/azure-functions/python:4-python3.14 python -c "from compression import zstd" -
Inspect CPython's recorded module build state:
docker run --platform linux/amd64 --rm mcr.microsoft.com/azure-functions/python:4-python3.14 python -c "import sysconfig; print(sysconfig.get_config_var('MODULE__ZSTD_STATE'))" -
Observe the import failure and the
missingbuild state.
Relevant code being tried
docker run --platform linux/amd64 --rm mcr.microsoft.com/azure-functions/python:4-python3.14 python -c "from compression import zstd"
docker run --platform linux/amd64 --rm mcr.microsoft.com/azure-functions/python:4-python3.14 python -c "import sysconfig; print(sysconfig.get_config_var('MODULE__ZSTD_STATE'))"
Relevant log output
Python 3.14.4
Traceback (most recent call last):
File "<string>", line 1, in <module>
from compression import zstd
File "/opt/python/3/lib/python3.14/compression/zstd/__init__.py", line 29, in <module>
import _zstd
ModuleNotFoundError: No module named '_zstd'
MODULE__ZSTD_STATE: missing
Installed runtime library:
libzstd1:amd64 1.5.5+dfsg2-2build1.1
libzstd.so.1
requirements.txt file
No third-party requirements are needed. The failure reproduces directly in the unmodified Azure Functions base image.
Where are you facing this problem?
Production Environment (explain below)
Function app name
No response
Additional Information
Image tested: mcr.microsoft.com/azure-functions/python:4-python3.14
Image digest at the time of testing:
sha256:2504f2b6dff243d671183e9dd6d607d1ae8f35e3536aa14965ffc3516749c1b8
CPython build requirements document Zstandard >= 1.4.5 for compression.zstd:
https://docs.python.org/3.14/using/configure.html#requirements-for-optional-modules
Impact: libraries may select the Python 3.14 standard-library Zstandard implementation based on the interpreter version. For example, starlette-compress uses compression.zstd on Python >= 3.14, so its default Zstandard support fails under this image even though it works with Python distributions that include _zstd. Installing the third-party zstandard package does not fix that import path.
Current application workaround: probe importlib.util.find_spec("_zstd") and disable Zstandard, falling back to Brotli or Gzip. The durable fix is to make the Zstandard development dependency available when CPython is compiled for the official Python 3.14 Functions runtime.
- Ngôn ngữ chính
- Python
- Star
- 357
- Fork
- 117
- Merge trung bình
- 9 ngày 27 phút
- Pull request đã merge (30 ngày)
- 3
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Azure/azure-functions-python-worker
-
[Bug] ASGI cookie conversion serializes an absent Domain attribute and breaks __Host- cookiesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 28/100
Azure/azure-functions-python-worker#1908 · 2 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
Azure/azure-functions-python-worker#1906 · 1 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
Tất cả issue của Azure/azure-functions-python-worker
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-2 ngày Mức phù hợp với người mới 70/100
-
FingerprintSplitter raises ZeroDivisionError when int(frac_train * len(dataset)) floors to zeroĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 7 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
lmstudio-ai/mlx-engine#376 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
pyiron/bagofholding#166 ·