mypy gives INTERNAL_ERROR when type checking files on read only filesystem (e.g. ro bind mount).
This can happen when running inside docker/checking files that you don't have write permission to.
$ mypy hello.py --show-traceback
error: INTERNAL ERROR -- Please try using mypy master on GitHub:
https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
Please report a bug at https://github.com/python/mypy/issues
version: 2.1.0
Traceback (most recent call last):
File "/home/karlicos/.local/share/uv/tools/mypy/lib/python3.14/site-packages/mypy/__main__.py", line 16, in console_entry
main()
~~~~^^
File "mypy/main.py", line 154, in main
File "mypy/main.py", line 244, in run_build
res = build.build(sources, options, None, flush_errors, fscache, stdout, stderr)
File "mypy/build.py", line 385, in build
File "mypy/build.py", line 1916, in create_metastore
mds: MetadataStore = SqliteMetadataStore(
File "mypy/metastore.py", line 192, in __init__
File "<frozen os>", line 226, in makedirs
File "<frozen os>", line 236, in makedirs
OSError: [Errno 30] Read-only file system: '.mypy_cache'
mkdir /tmp/ro
cd /tmp/ro
echo 'x: int = "a"' > hello.py
chmod -w /tmp/ro
mypy hello.py --show-traceback
I also reproduced in a clean environment with Claude, so pretty sure it's unaffected by my system conviguration.
Crash Report
mypy gives INTERNAL_ERROR when type checking files on read only filesystem (e.g. ro bind mount).
This can happen when running inside docker/checking files that you don't have write permission to.
Traceback
To Reproduce
Your Environment
mypy.ini(and other config files): N/ALinux 7.0.0-15-generic #15-Ubuntu SMP PREEMPT_DYNAMICDebugging attempt
I also reproduced in a clean environment with Claude, so pretty sure it's unaffected by my system conviguration.
--no-sqlite-cachethe crash doesn't happen