https://github.com/python/cpython/commit/467507a651e351712f18fcafad64d1b5eed89b7d
commit: 467507a651e351712f18fcafad64d1b5eed89b7d
branch: main
author: Charlie Lin <[email protected]>
committer: encukou <[email protected]>
date: 2026-03-10T16:21:33+01:00
summary:

gh-145697: Add `.sql` and `.sqlite3` recognition in `mimetypes` (GH-145698)


Co-authored-by: Stan Ulbrych <[email protected]>
Co-authored-by: Benedikt Johannes <[email protected]>

files:
A Misc/NEWS.d/next/Library/2026-03-09-18-33-16.gh-issue-145697.d6hFmm.rst
M Doc/whatsnew/3.15.rst
M Lib/mimetypes.py
M Lib/test/test_mimetypes.py

diff --git a/Doc/whatsnew/3.15.rst b/Doc/whatsnew/3.15.rst
index ead4e7cbf2871e..e749ef2a455ea2 100644
--- a/Doc/whatsnew/3.15.rst
+++ b/Doc/whatsnew/3.15.rst
@@ -825,6 +825,8 @@ mimetypes
 * Add ``application/node`` MIME type for ``.cjs`` extension.
   (Contributed by John Franey in :gh:`140937`.)
 * Add ``application/toml``. (Contributed by Gil Forcada in :gh:`139959`.)
+* Add ``application/sql`` and ``application/vnd.sqlite3``.
+  (Contributed by Charlie Lin in :gh:`145698`.)
 * Add ``image/jxl``. (Contributed by Foolbar in :gh:`144213`.)
 * Rename ``application/x-texinfo`` to ``application/texinfo``.
   (Contributed by Charlie Lin in :gh:`140165`.)
diff --git a/Lib/mimetypes.py b/Lib/mimetypes.py
index fc916c470a0110..ee66160be63b6f 100644
--- a/Lib/mimetypes.py
+++ b/Lib/mimetypes.py
@@ -501,6 +501,7 @@ def _default_mime_types():
         '.ps'     : 'application/postscript',
         '.eps'    : 'application/postscript',
         '.rtf'    : 'application/rtf',
+        '.sql'    : 'application/sql',
         '.texi'   : 'application/texinfo',
         '.texinfo': 'application/texinfo',
         '.toml'   : 'application/toml',
@@ -525,6 +526,8 @@ def _default_mime_types():
         '.xlsx'   : 
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
         '.docx'   : 
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
         '.rar'    : 'application/vnd.rar',
+        '.sqlite3': 'application/vnd.sqlite3',
+        '.sqlite' : 'application/vnd.sqlite3',
         '.wasm'   : 'application/wasm',
         '.7z'     : 'application/x-7z-compressed',
         '.bcpio'  : 'application/x-bcpio',
diff --git a/Lib/test/test_mimetypes.py b/Lib/test/test_mimetypes.py
index fe7584f1f9d3b3..2d618081521e10 100644
--- a/Lib/test/test_mimetypes.py
+++ b/Lib/test/test_mimetypes.py
@@ -232,6 +232,7 @@ def check_extensions():
                 ("application/pdf", ".pdf"),
                 ("application/postscript", ".ps"),
                 ("application/rtf", ".rtf"),
+                ("application/sql", ".sql"),
                 ("application/texinfo", ".texi"),
                 ("application/toml", ".toml"),
                 ("application/vnd.apple.mpegurl", ".m3u"),
@@ -246,6 +247,7 @@ def check_extensions():
                 
("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", ".xlsx"),
                 
("application/vnd.openxmlformats-officedocument.wordprocessingml.document", 
".docx"),
                 ("application/vnd.rar", ".rar"),
+                ("application/vnd.sqlite3", ".sqlite3"),
                 ("application/x-7z-compressed", ".7z"),
                 ("application/x-debian-package", ".deb"),
                 ("application/x-httpd-php", ".php"),
diff --git 
a/Misc/NEWS.d/next/Library/2026-03-09-18-33-16.gh-issue-145697.d6hFmm.rst 
b/Misc/NEWS.d/next/Library/2026-03-09-18-33-16.gh-issue-145697.d6hFmm.rst
new file mode 100644
index 00000000000000..c3a476df75f136
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2026-03-09-18-33-16.gh-issue-145697.d6hFmm.rst
@@ -0,0 +1 @@
+Add ``application/sql`` and ``application/vnd.sqlite3`` into ``mimetypes``.

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to