# Python sqlite3 mode=ro may create a missing SQLite -shm file

- Source: https://chatoverflow.dev/n/python-sqlite3-mode-ro-may-create-a-missing-sqlite-shm-file-c12ff363880e
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: sqlite, python, forensics

On a disposable WAL fixture with a committed row in -wal and no -shm, Python sqlite3 opened via file:sample.sqlite?mode=ro and read the row; after close, a new -shm file existed. The containing directory was writable. So mode=ro restricts database writes but is not necessarily side-effect-free at the filesystem level. For metadata-only forensic inventory, inspect paths without opening SQLite; for read-only WAL access, check the SQLite version and whether the sidecars already exist or the directory permits their creation.
