Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import os
import pathlib

from typing import Dict, List, NamedTuple, Tuple
from typing import Dict, List, NamedTuple


DIRECTORY = pathlib.Path(__file__).parent
Expand Down Expand Up @@ -130,7 +130,7 @@ def readProject(root) -> Dict[str, Package]:
return {x: _makePackage(x, y) for x, y in initialRead.items()}


def writeAutoGenerated(files : List[str]) -> None:
def writeAutoGenerated(files: List[str]) -> None:
"""
Writes the _autogen.txt file.
"""
Expand All @@ -139,4 +139,4 @@ def writeAutoGenerated(files : List[str]) -> None:


if __name__ == '__main__':
run()
run()
3 changes: 2 additions & 1 deletion extract_msg/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def strSanitize(inp):
msg.saveAttachments(**kwargs)
else:
msg.save(**kwargs)
except Exception as e:
except Exception:
try:
print(f'Error with file "{x}": {traceback.format_exc()}')
except UnicodeEncodeError:
Expand All @@ -111,5 +111,6 @@ def strSanitize(inp):
if createdZip:
_zip.close()


if __name__ == '__main__':
main(sys.argv)
4 changes: 2 additions & 2 deletions extract_msg/attachments/custom_att_handler/lnk_obj_att.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


from functools import cached_property
from typing import List, Optional, TYPE_CHECKING
from typing import Optional, TYPE_CHECKING

from . import registerHandler
from .custom_handler import CustomAttachmentHandler
Expand Down Expand Up @@ -106,4 +106,4 @@ def obj(self) -> None:



registerHandler(LinkedObjectAttachment)
registerHandler(LinkedObjectAttachment)
2 changes: 1 addition & 1 deletion extract_msg/attachments/web_att.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ def url(self) -> Optional[str]:
The url for the web attachment. If this is not set, that is probably an
error.
"""
return self.longPathname
return self.longPathname
2 changes: 1 addition & 1 deletion extract_msg/constants/ps.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@
PSETID_SHARING: Final[str] = '{00062040-0000-0000-C000-000000000046}'
PSETID_XMLEXTRACTEDENTITIES: Final[str] = '{23239608-685D-4732-9C55-4C95CB4E8E33}'
PSETID_ATTACHMENT: Final[str] = '{96357F7F-59E1-47D0-99A7-46515C183B54}'
PSETID_CALENDAR_ASSISTANT: Final[str] = '{11000E07-B51B-40D6-AF21-CAA85EDAB1D0}'
PSETID_CALENDAR_ASSISTANT: Final[str] = '{11000E07-B51B-40D6-AF21-CAA85EDAB1D0}'
4 changes: 2 additions & 2 deletions extract_msg/constants/st.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
ST_BE_UI16: Final[struct.Struct] = struct.Struct('>H')
ST_BE_UI32: Final[struct.Struct] = struct.Struct('>I')
ST_BE_UI64: Final[struct.Struct] = struct.Struct('>Q')
ST_BE_F32: Final[struct.Struct] = struct.Struct('>f')
ST_BE_F32: Final[struct.Struct] = struct.Struct('>f')
ST_BE_F64: Final[struct.Struct] = struct.Struct('>d')
# Structs that use the system byte order, where consistency on a single system
# is all that matters. Mainly used for quick casts between signed and unsigned.
Expand All @@ -107,4 +107,4 @@
ST_SBO_UI64: Final[struct.Struct] = struct.Struct('@Q')
# Struct for an RGB value that, in little endian, would be an int written in hex
# as 0x00BBGGRR.
ST_RGB: Final[struct.Struct] = struct.Struct('<BBBx')
ST_RGB: Final[struct.Struct] = struct.Struct('<BBBx')
2 changes: 1 addition & 1 deletion extract_msg/msg_classes/message_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def asEmailMessage(self) -> EmailMessage:
if self.body:
bodyParts.attach(MIMEText(self.body, 'plain', c))
if self.htmlBody:
bodyParts.attach(MIMEText(str(bs4.BeautifulSoup(self.htmlBody)), 'html', c))
bodyParts.attach(MIMEText(str(bs4.BeautifulSoup(self.htmlBody, features = 'html.parser')), 'html', c))

# Process attachments.
for att in self.attachments:
Expand Down
Loading