milahu <mil...@gmail.com> added the comment:

this issue is different than Issue32462
because here, both entries are valid

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

but the alphabetical ordering of the file
makes the last entry take precedence

python could be smarter at parsing the /etc/mime.types file
in that it could give lower precedence to the deprecated types

pseudocode:

deprecated_mimetypes = set(...) # values from rfc4329
mimetype_of_ext = dict()
# parser loop
for ...
  ext = "..."
  mimetype = "..."
  if ext in mimetype_of_ext:
    old_mimetype = mimetype_of_ext[ext]
    if old_mimetype in deprecated_mimetypes:
      mimetype_of_ext[ext] = mimetype # replace old with new
      # assume that mimetype is not deprecated
  mimetype_of_ext[ext] = mimetype

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue46035>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to