Skip to content

Commit 8c7d2fa

Browse files
authored
Merge pull request #159 from zevisert/zev/fix/GH-154-python-mimetypes-patch
replace mimetypes patch for python 3.14.9+
2 parents 473de6b + 48f5281 commit 8c7d2fa

2 files changed

Lines changed: 27 additions & 0 deletions

File tree

‎flake.nix‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,11 @@
294294
condition = version: versionInBetween version "3.12" "3.11";
295295
override = filterOutPatch "f4b31edf2d9d72878dab1f66a36913b5bcc848ec.patch";
296296
}
297+
{
298+
# CPython 3.14.9 moved knownfiles into a non-Windows branch.
299+
condition = version: versionInBetween version "3.15" "3.14.9";
300+
override = replacePatch "mimetypes.patch" ./patches/3.14.9-mimetypes.patch;
301+
}
297302
{
298303
# Merged upstream in CPython 3.14.5: https://github.com/python/cpython/pull/146265
299304
condition = version: versionInBetween version "3.15" "3.14.5";

‎patches/3.14.9-mimetypes.patch‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
diff --git a/Lib/mimetypes.py b/Lib/mimetypes.py
2+
--- a/Lib/mimetypes.py
3+
+++ b/Lib/mimetypes.py
4+
@@ -49,16 +49,8 @@
5+
knownfiles = []
6+
else:
7+
knownfiles = [
8+
- "/etc/mime.types",
9+
- "/etc/httpd/mime.types", # Mac OS X
10+
- "/etc/httpd/conf/mime.types", # Apache
11+
- "/etc/apache/mime.types", # Apache 1
12+
- "/etc/apache2/mime.types", # Apache 2
13+
- "/usr/local/etc/httpd/conf/mime.types",
14+
- "/usr/local/lib/netscape/mime.types",
15+
- "/usr/local/etc/httpd/conf/mime.types", # Apache 1.2
16+
- "/usr/local/etc/mime.types", # Apache 1.3
17+
- ]
18+
+ "@mime-types@/etc/mime.types",
19+
+ ]
20+
21+
inited = False
22+
_db = None

0 commit comments

Comments
 (0)