Author Michał Szymaniak
Recipients Michał Szymaniak
Date 2019-11-03.12:33:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
When user lacks rights to read on of the mimetypes.knownfiles, mimetypes init() will throw PermissionError and library becomes unusable.

Reproduction steps:
# mkdir -p /etc/httpd/conf/
# touch /etc/httpd/conf/mime.types
# chmod a-r /etc/httpd/conf/mime.types
$ python
>>> import mimetypes
>>> mimetypes.init()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.7/", line 355, in init
  File "/usr/lib/python3.7/", line 204, in read
    with open(filename, encoding='utf-8') as fp:
PermissionError: [Errno 13] Permission denied: '/etc/httpd/conf/mime.types'
Date User Action Args
2019-11-03 12:33:22Michał Szymaniaksetrecipients: + Michał Szymaniak
2019-11-03 12:33:22Michał Szymaniaksetmessageid: <>
2019-11-03 12:33:21Michał Szymaniaklinkissue38672 messages
2019-11-03 12:33:21Michał Szymaniakcreate