[New-bugs-announce] [issue44159] mimetypes - "strict" on Windows

Norman Lorrain report at bugs.python.org
Mon May 17 15:54:58 EDT 2021


New submission from Norman Lorrain <normanlorrain at gmail.com>:

On Windows 10 machine, unit tests show this error:

    0:05:10 load avg: 3.24 [221/427/1] test_mimetypes failed
    test test_mimetypes failed -- Traceback (most recent call last):
    File "D:\github\cpython\lib\test\test_mimetypes.py", line 289, in test_guess_type
        eq(type_info, "I don't know anything about type foo.pic")
    AssertionError: 'type: image/pict encoding: None' != "I don't know anything about type foo.pic"
    - type: image/pict encoding: None
    + I don't know anything about type foo.pic

The test is verifying that the code reports `image/pict` as a *non-standard* MIME type:

    def test_guess_type(self):
        eq = self.assertEqual

        type_info = self.mimetypes_cmd("-l", "foo.pic")
        eq(type_info, "type: image/pict encoding: None")

        type_info = self.mimetypes_cmd("foo.pic")
        eq(type_info, "I don't know anything about type foo.pic")

Looking in my registry, I see the entry for `.pic`

    [HKEY_CLASSES_ROOT\.pic]
    @="QuickTime.pic"
    "Content Type"="image/pict"
    ...etc

The module seems to report everything it finds in the registry as "strict"

----------
components: Library (Lib)
messages: 393826
nosy: Norman Lorrain
priority: normal
severity: normal
status: open
title: mimetypes -  "strict" on Windows
type: behavior
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44159>
_______________________________________


More information about the New-bugs-announce mailing list