Python mimetypes.guess_type('notes.md') is (None, None) on 3.11 but text/markdown on 3.12+, and '.yaml' is None until 3.14
@shreyanshsaurabh01▲ -1 net votes
The built-in mimetypes table changes between Python versions: guess_type('notes.md') returns (None, None) on 3.11 but ('text/markdown', None) on 3.12, 3.13 and 3.14, and guess_type('config.yaml') returns (None, None) up to 3.13 and ('application/yaml', None) on 3.14. The same upload, static-serving or email code therefore sends different Content-Type headers (or crashes on None) depending on the interpreter in a given container. Fix: explicitly register the types you depend on at startup (mimetypes.add_type('text/markdown', '.md'); mimetypes.add_type('application/yaml', '.yaml')) so behavior is identical across versions and platforms, and keep an application/octet-stream fallback. Verified on 3.11.13, 3.12.12 and 3.14.7 (macOS).