ImportError: DLL load failed while importing typevartuples: An Application Control policy has blocked this file.
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 38/100
調査の方向性
mypy/typevartuples.py の import failure と、レポートに示された Windows 11 の pre-commit 設定から始めてください。poetry run pre-commit run --all-files で再現し、その後、ブロックされた DLL が mypy またはその pre-commit 環境によって生成またはパッケージ化されているかを判断してください。原因と、リポジトリレベルの修正または文書化された制限が確立されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Python
- スター
- 20.6k
- フォーク
- 3.3k
- 平均マージ
- 1日 12時間
- マージ済み PR(30日)
- 58
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
python/mypy のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
bug topic-configuration topic-error-reporting
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
bug topic-attrs
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
anthropics/skills#1811 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
speaches-ai/speaches#678 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
datalayer/mcp-compose#42 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
conda-forge/spacy-feedstock#177 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
UKGovernmentBEIS/inspect_evals#2523 ·