Skip to content

dmypy crashes when native parser and parallel checking are enabled. #21475

@Jazzinghen

Description

@Jazzinghen

Crash Report

I tried to use dmypy with both the native parser on and a number of workers greater than 1. As soon as I ran dmypy check file.py I got a FileExistsError

Traceback

Daemon crashed!
Traceback (most recent call last):
  File "mypy/dmypy_server.py", line 239, in serve
  File "mypy/dmypy_server.py", line 288, in run_command
    ret = method(self, **data)
  File "mypy/dmypy_server.py", line 366, in cmd_check
    return self.check(sources, export_types, is_tty, terminal_width)
  File "mypy/dmypy_server.py", line 430, in check
    res = self.initialize_fine_grained(sources, is_tty, terminal_width)
  File "mypy/dmypy_server.py", line 469, in initialize_fine_grained
    result = mypy.build.build(sources=sources, options=self.options, fscache=self.fscache)
  File "mypy/build.py", line 392, in build
  File "<frozen os>", line 236, in makedirs
FileExistsError: [Errno 17] File exists: '/dev/null'

To Reproduce

  1. Configure mypy to use the native parser and parallel checks
[project]
name = "dmypy_crash"
requires-python = ">=3.14"
dependencies = ["mypy >= 2.0"]

[tool.mypy]
python_version = "3.14"
native_parser = true
num_workers = 8
ignore_missing_imports = true
implicit_optional = false
strict_optional = true
strict = true
disallow_untyped_defs = true
  1. Create any Python file
print("Hello world")
  1. Start dmypy
dmypy start
  1. Check the file
dmypy check hello_world.py

Your Environment

  • Mypy version used: 2.0
  • Mypy configuration options from mypy.ini (and other config files):
    • python_version = "3.14"
    • native_parser = true
    • num_workers = 8
    • mypy_path = "$MYPY_CONFIG_FILE_DIR/src"
    • ignore_missing_imports = true
    • implicit_optional = false
    • strict = true
    • strict_optional = true
    • implicit_optional = false
    • disallow_untyped_defs = true
  • Python version used: 3.14.4
    • Mypy runs into a virtual environment handled by uv
    • uv version used: 0.11.13
  • Operating system and version: Linux 7.0.5-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 08 May 2026 09:29:23 +0000 x86_64 GNU/Linux

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions