Message356853
I'm seeing the same in ranger and I'm currently trying to debug this - I'm still
not quite sure what I'm seeing as there seem to be various issues/weirdnesses
which overlap each other.
This strikes me as odd:
>>> import mimetypes
>>> mimetypes.guess_type('E01.mkv')
('video/x-matroska', None)
>>> mimetypes.types_map['.mkv']
'video/x-matroska'
>>> mt = mimetypes.MimeTypes()
>>> mt.guess_type('E01.mkv')
(None, None)
>>> mt.types_map
({'.rtf': 'application/rtf', [redacted for brevity]}, {'.js': 'application/javascript', [redacted for brevity]})
>>> mt.types_map[0]['.mkv']
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
KeyError: '.mkv'
>>> mt.types_map[1]['.mkv']
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
KeyError: '.mkv'
The Python documentation claims: "This class represents a MIME-types database.
By default, it provides access to the same database as the rest of this module.
The initial database is a copy of that provided by the module" - yet that
apparently isn't the case.
I see this with both Python 3.7.5 and 3.8.0, but with 3.6.9 I get the correct
output for both module- and class-level access. |
|
Date |
User |
Action |
Args |
2019-11-18 09:47:13 | The Compiler | set | recipients:
+ The Compiler, ammar2, xtreak, toonn |
2019-11-18 09:47:13 | The Compiler | set | messageid: <1574070433.01.0.843005644157.issue38656@roundup.psfhosted.org> |
2019-11-18 09:47:12 | The Compiler | link | issue38656 messages |
2019-11-18 09:47:12 | The Compiler | create | |
|