Message355897
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/mimetypes.py", line 355, in init
db.read(file)
File "/usr/lib/python3.7/mimetypes.py", 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:22 | Michał Szymaniak | set | recipients:
+ Michał Szymaniak |
2019-11-03 12:33:22 | Michał Szymaniak | set | messageid: <1572784402.07.0.839086408394.issue38672@roundup.psfhosted.org> |
2019-11-03 12:33:21 | Michał Szymaniak | link | issue38672 messages |
2019-11-03 12:33:21 | Michał Szymaniak | create | |
|