Skip to content

converting an s/mime signed message fails with missing import "inputToBytes" #286

@FObersteiner

Description

@FObersteiner

converting an s/mime signed message raises

[...]
Traceback (most recent call last):
  File "/home/user/Software/msg-extractor/extract_msg/__main__.py", line 106, in main
    with utils.openMsg(x, **openKwargs) as msg:
  File "/home/user/Software/msg-extractor/extract_msg/utils.py", line 615, in openMsg
    return MessageSigned(path, **kwargs)
  File "/home/user/Software/msg-extractor/extract_msg/message_signed_base.py", line 51, in __init__
    super().__init__(path, **kwargs)
  File "/home/user/Software/msg-extractor/extract_msg/message_base.py", line 86, in __init__
    super().__init__(path, **kwargs)
  File "/home/user/Software/msg-extractor/extract_msg/msg.py", line 154, in __init__
    self.attachments
  File "/home/user/Software/msg-extractor/extract_msg/message_signed_base.py", line 81, in attachments
    self._signedHtmlBody = inputToBytes(unwrapped['html_body'], 'utf-8')
NameError: name 'inputToBytes' is not defined

on my system.

  • Version of extract_msg: 0.36.1
  • Python 3.9.13
  • happens both via CLI or in a .py script

I'm not sure if this is related to the type of signature but I could easily fix the error by changing line 11 in message_signed_base.py to

from .utils import inputToBytes, inputToString, unwrapMultipart

Output is fine afterwards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions