Skip to content

Commit

Permalink
Fix MIME type check for example OFX importer.
Browse files Browse the repository at this point in the history
Ensure that we will accept the non-strict type we added,
and don't try to match a tuple against a string.
  • Loading branch information
josephw committed Jun 28, 2024
1 parent 5033c2f commit 79ca72c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/importers/ofx.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 79ca72c

Please sign in to comment.