From 79ca72ced9429d07445f3887c5a4d980cfc3afde Mon Sep 17 00:00:00 2001 From: Joseph Walton Date: Fri, 28 Jun 2024 17:27:59 +1000 Subject: [PATCH] Fix MIME type check for example OFX importer. Ensure that we will accept the non-strict type we added, and don't try to match a tuple against a string. --- examples/importers/ofx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/importers/ofx.py b/examples/importers/ofx.py index 9e5977b..8ba6598 100644 --- a/examples/importers/ofx.py +++ b/examples/importers/ofx.py @@ -66,7 +66,7 @@ def __init__(self, acctid_regexp, account, basename=None, def identify(self, filepath): # Match for a compatible MIME type. - if mimetypes.guess_type(filepath) not in {'application/x-ofx', + if mimetypes.guess_type(filepath, strict=False)[0] not in {'application/x-ofx', 'application/vnd.intu.qbo', 'application/vnd.intu.qfx'}: return False