From 431485ad020a4d02501a9873800368a05ec0188f Mon Sep 17 00:00:00 2001 From: Sean Whalen Date: Tue, 2 Dec 2025 20:09:48 -0500 Subject: [PATCH] Update docs --- _modules/parsedmarc.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/_modules/parsedmarc.html b/_modules/parsedmarc.html index b2ac8f2e..8c695163 100644 --- a/_modules/parsedmarc.html +++ b/_modules/parsedmarc.html @@ -963,9 +963,7 @@ try: file_object = BytesIO(b64decode(content)) except binascii.Error: - pass - if file_object is None: - file_object = open(content, "rb") + return content elif type(content) is bytes: file_object = BytesIO(content) else: @@ -989,10 +987,12 @@ file_object.close() except UnicodeDecodeError: - file_object.close() + if file_object: + file_object.close() raise ParserError("File objects must be opened in binary (rb) mode") except Exception as error: - file_object.close() + if file_object: + file_object.close() raise ParserError("Invalid archive file: {0}".format(error.__str__())) return report