This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author milahu
Recipients milahu
Date 2021-12-10.12:10:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1639138259.47.0.962118215101.issue46035@roundup.psfhosted.org>
In-reply-to
Content
deprecated mimetype?
per rfc4329, the technical term is "unregistered media type"

https://datatracker.ietf.org/doc/html/rfc4329#section-3

related

https://stackoverflow.com/a/9664327/10440128

https://github.com/danny0838/PyWebScrapBook/issues/53

quick fix

```py
# python/Lib/mimetypes.py

class MimeTypes:
# ...
    def guess_type(self, url, strict=True):
# ...

        if ext in _types_map_default:
            # prefer the python-internal values over /etc/mime.types
            return _types_map_default[ext], encoding

        if ext in types_map:
            return types_map[ext], encoding
```

why is `application/x-javascript` returned?

on linux, mimetypes.init() loads /etc/mime.types
source:
https://mirrors.kernel.org/gentoo/distfiles/mime-types-9.tar.bz2

/etc/mime.types is sorted by alphabet, so

```
cat /etc/mime.types | grep javascript
application/javascript										js
application/x-javascript									js
```

apparently, the last entry application/x-javascript
will overwrite the previous entry application/javascript
History
Date User Action Args
2021-12-10 12:10:59milahusetrecipients: + milahu
2021-12-10 12:10:59milahusetmessageid: <1639138259.47.0.962118215101.issue46035@roundup.psfhosted.org>
2021-12-10 12:10:59milahulinkissue46035 messages
2021-12-10 12:10:59milahucreate