python / python/mypy

ImportError: DLL load failed while importing typevartuples: An Application Control policy has blocked this file.

Abierto
#21,759 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

crash
Lenguaje dominante
Python
Estrellas
20.6k
Forks
3.3k
Métricas de merge de PR
Métricas de PR pendientes

Descripción

Crash Report

On Windows 11 SAC flags mypy as having a security issues cause the publisher cannot be verified of one of the DLLs.

Traceback

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\bani5\.cache\pre-commit\repo6vsqreec\py_env-python3.13\Scripts\mypy.EXE\__main__.py", line 2, in <module>
    from mypy.__main__ import console_entry
  File "C:\Users\bani5\.cache\pre-commit\repo6vsqreec\py_env-python3.13\Lib\site-packages\mypy\__main__.py", line 9, in <module>
    from mypy.main import main, process_options
  File "mypy\main.py", line 17, in <module>
    from mypy import build, defaults, state, util
  File "mypy\build.py", line 33, in <module>
  File "mypy\semanal_main.py", line 37, in <module>
    from mypy.checker import FineGrainedDeferredNode
  File "mypy\checker.py", line 23, in <module>
  File "mypy\checkexpr.py", line 16, in <module>
    from mypy import applytype, erasetype, join, message_registry, nodes, operators, types
  File "mypy\applytype.py", line 6, in <module>
  File "mypy\subtypes.py", line 9, in <module>
  File "mypy\constraints.py", line 10, in <module>
    import mypy.typeops
  File "mypy\typeops.py", line 14, in <module>
    from mypy.checker_state import checker_state
  File "mypy\checker_state.py", line 7, in <module>
    from mypy.checker_shared import TypeCheckerSharedApi
  File "mypy\checker_shared.py", line 13, in <module>
    from mypy.errors import ErrorWatcher
  File "mypy\errors.py", line 18, in <module>
    from mypy.types import Type
  File "mypy\types.py", line 4425, in <module>
  File "mypy\expandtype.py", line 44, in <module>
    from mypy.typevartuples import split_with_instance
ImportError: DLL load failed while importing typevartuples: An Application Control policy has blocked this file.

To Reproduce

mypy is my last pre-commit hook and it fails.

poetry run pre-commit run --all-files

Your Environment

# `pre-commit install` (no flags) installs both the pre-commit and commit-msg git
# hooks, so the file checks/linters and the conventional-commit message check both run.
default_install_hook_types: [pre-commit, commit-msg]

repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v6.0.0
    hooks:
      - id: end-of-file-fixer
      - id: trailing-whitespace
      - id: check-merge-conflict
      - id: no-commit-to-branch
        args: [ "--branch", "main", "--branch", "develop" ]
      - id: check-toml
      - id: check-json
      - id: mixed-line-ending
      - id: check-yaml
        args: [ "--allow-multiple-documents" ]
      - id: check-added-large-files
        args: [ "--maxkb=500" ]
      - id: check-case-conflict
      - id: check-docstring-first
      - id: check-executables-have-shebangs
      - id: check-shebang-scripts-are-executable
      - id: debug-statements
      - id: name-tests-test
        args: ['--pytest-test-first']
      - id: requirements-txt-fixer

  - repo: https://github.com/astral-sh/ruff-pre-commit
    rev: v0.15.7
    hooks:
      - id: ruff
        args:
          - --fix
          - --target-version=py313
          - --line-length=120
          - --select=E,F,I,B,C,W,UP,ARG,PERF,PL,RET,SIM,TID,ERA,PD,PGH,PT,PYI,RUF
          - --ignore=E501,B008,PLR0913,ERA001
        language_version: python3.13
      - id: ruff-format
        args:
          - --target-version=py313
          - --line-length=120
        language_version: python3.13

  - repo: https://github.com/pre-commit/mirrors-mypy
    rev: v1.19.1
    hooks:
      - id: mypy
        args:
          - --config-file=pyproject.toml
          - --ignore-missing-imports
        additional_dependencies:
          - types-requests>=2.32.0
          - types-tabulate>=0.9.0
          - types-PyYAML>=6.0
          - pydantic
          - sqlalchemy[mypy]
        language_version: python3.13

  - repo: https://github.com/compilerla/conventional-pre-commit
    rev: v4.4.0
    hooks:
      - id: conventional-pre-commit
        stages: [commit-msg]
        args:
          # `types` are positional arguments (not a --types flag); --scopes is an option.
          - --scopes=api,db,config,test,docs,ci,infra,security,qa,orchestrator,worker,prompts
          - feat
          - fix
          - docs
          - style
          - refactor
          - test
          - chore
          - perf
          - ci
          - build
          - revert

OS: Windows 11

Guía de contribución

Abrir la guía de contribución

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.

Línea de trabajo

Empieza por el fallo de importación en mypy/typevartuples.py y la configuración de pre-commit de Windows 11 mostrada en el informe. Reproduce el fallo con poetry run pre-commit run --all-files y determina después si la DLL bloqueada la produce o empaqueta mypy o su entorno de pre-commit. Se considera terminado cuando se hayan establecido la causa y una corrección a nivel del repositorio o una limitación documentada.

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

Evaluación

Stack tecnológico
python
Área
devtools, tooling
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Tranquilo
Claridad
Necesita aclaración
Aptitud para principiantes
38/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.