Skip to content

gh-159428: Don't read mimetypes.knownfiles by default on Windows - #159445

Open
cjames23 wants to merge 1 commit into
python:mainfrom
cjames23:gh-159428-mimetypes-windows
Open

cjames23 wants to merge 1 commit into
python:mainfrom
cjames23:gh-159428-mimetypes-windows

Conversation

@cjames23

@cjames23 cjames23 commented Oct 15, 2026 •

Copy link
Copy Markdown

Make knownfiles empty on Windows so that only the registry is used by default. Files passed to init() or assigned to knownfiles explicitly are still read.

The default knownfiles are POSIX paths such as /etc/mime.types. On Windows these resolve against the root of the current drive (e.g. C:\etc\mime.types), a location that unprivileged users can usually create.

Make knownfiles empty on Windows so that only the registry is used by default. Files passed to init() or assigned to knownfiles explicitly are still read.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant