diff --git a/extract_msg/enums.py b/extract_msg/enums.py index 8c4986f2..4ab563cc 100644 --- a/extract_msg/enums.py +++ b/extract_msg/enums.py @@ -400,7 +400,7 @@ def fromBits(cls, value : int) -> Set['ElectronicAddressProperties']: raise ValueError('Value must not be negative.') # This is a quick compressed way to convert the bits in the int into # a tuple of instances of this class should any bit be a 1. - return {cls(int(x)) for index, val in enumerate(bin(value)[:1:-1]) if val == '1'} + return {cls(int(index)) for index, val in enumerate(bin(value)[:1:-1]) if val == '1'} EMAIL_1 = 0x00000000 EMAIL_2 = 0x00000001 diff --git a/extract_msg/prop.py b/extract_msg/prop.py index 2c7b3809..8cf61a80 100644 --- a/extract_msg/prop.py +++ b/extract_msg/prop.py @@ -1,8 +1,6 @@ import datetime import logging -import olefile - from typing import Any from . import constants @@ -78,7 +76,7 @@ def rawData(self) -> bytes: """ The raw bytes used to create this object. """ - return self.__raw + return self.__rawData @property def type(self) -> int: @@ -139,7 +137,7 @@ def parseType(self, _type : int, stream : bytes) -> Any: # wasn't. So we are just returning the int. However, we want to see # if it is a normal error type. try: - logger.warning(f'REPORT TO DEVELOPERS: Error type of {ErrorType(value)} was found.') + logger.warning(f'REPORT TO DEVELOPERS: Error type of {ErrorCode(value)} was found.') except ValueError: pass elif _type == 0x000B: # PtypBoolean @@ -152,7 +150,7 @@ def parseType(self, _type : int, stream : bytes) -> Any: value = filetimeToDatetime(rawTime) except ValueError as e: logger.exception(e) - logger.error(self.raw) + logger.error(self.rawData) elif _type == 0x0048: # PtypGuid # TODO parsing for this pass diff --git a/extract_msg/utils.py b/extract_msg/utils.py index 52668210..4abd3e7d 100644 --- a/extract_msg/utils.py +++ b/extract_msg/utils.py @@ -794,7 +794,7 @@ def parseType(_type : int, stream, encoding, extras): # wasn't. So we are just returning the int. However, we want to see # if it is a normal error type. try: - logger.warning(f'REPORT TO DEVELOPERS: Error type of {ErrorType(value)} was found.') + logger.warning(f'REPORT TO DEVELOPERS: Error type of {ErrorCode(value)} was found.') except ValueError: pass return value