Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Python 3.14 runtime image omits _zstd, so compression.zstd cannot import

Abierto
#1,887 0 comentarios 1 reacción 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
docker, python

Línea de trabajo

Empieza ejecutando los dos comandos de Docker proporcionados contra mcr.microsoft.com/azure-functions/python:4-python3.14 y confirma el fallo de importación y el valor de MODULE__ZSTD_STATE. Después, rastrea la configuración de compilación de Python y de dependencias de la imagen para encontrar dónde se selecciona la dependencia de desarrollo de Zstandard. Se considera terminado cuando la imagen oficial reconstruida importa compression.zstd correctamente e indica que el módulo _zstd está presente.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug python
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
  1. Pull the current official image:

    docker pull --platform linux/amd64 mcr.microsoft.com/azure-functions/python:4-python3.14

  2. 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"

  3. 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'))"

  4. Observe the import failure and the missing build 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.

Lenguaje dominante
Python
Estrellas
357
Forks
117
Merge medio
9 d 27 min
PR fusionados (30 d)
3

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Azure/azure-functions-python-worker

Todos los issues de Azure/azure-functions-python-worker

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.