classification
Title: http.server doesn't guess n-quads, n-triples, notation3 and TriG MIME types
Type: enhancement Stage: patch review
Components: Library (Lib) Versions: Python 3.10, Python 3.9
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: DylanVanAssche, eric.araujo
Priority: normal Keywords: patch

Created on 2020-10-26 17:56 by DylanVanAssche, last changed 2020-11-10 17:41 by DylanVanAssche.

Pull Requests
URL Status Linked Edit
PR 23230 open DylanVanAssche, 2020-11-10 17:41
Messages (3)
msg379676 - (view) Author: Dylan Van Assche (DylanVanAssche) * Date: 2020-10-26 17:56
guess_format() from lib/mimetypes.py doesn't guess correctly the following MIME types:

- .nq: application/n-quads (specification: https://www.w3.org/TR/n-quads/)
- .nt: application/n-triples (specification: https://www.w3.org/TR/n-triples/)
- .n3: text/n3 (specification: https://www.w3.org/TeamSubmission/n3/)
- .trig: application/trig (specification: https://www.w3.org/TR/trig/)

In these cases the default MIME type is returned: application/octet-stream
msg379677 - (view) Author: Dylan Van Assche (DylanVanAssche) * Date: 2020-10-26 18:11
Adding the MIME types to /etc/mime.types fixes this issue, but I'm not sure if that's the right 'fix'
msg380291 - (view) Author: √Čric Araujo (eric.araujo) * (Python committer) Date: 2020-11-03 18:52
Editing /etc/mime.types is one way of customizing the types returned; another one is to make a pull request to add them to the list inside the mimetypes module.
History
Date User Action Args
2020-11-10 17:41:32DylanVanAsschesetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request22126
2020-11-03 18:52:36eric.araujosetversions: - Python 3.6, Python 3.7, Python 3.8
nosy: + eric.araujo

messages: + msg380291

stage: needs patch
2020-10-26 18:11:11DylanVanAsschesetmessages: + msg379677
2020-10-26 18:03:00DylanVanAsschesettitle: http.server MIME type doesn't guess n-quads, n-triples, notation3 and TriG MIME types -> http.server doesn't guess n-quads, n-triples, notation3 and TriG MIME types
2020-10-26 18:02:39DylanVanAsschesettitle: guess_format() MIME type doesn't guess n-quads, n-triples, notation3 and TriG -> http.server MIME type doesn't guess n-quads, n-triples, notation3 and TriG MIME types
2020-10-26 17:56:56DylanVanAsschecreate