Skip to content

[BUG] MSG file with no properties stream raises deeply nested NoneType error instead of handling it properly. #302

@piskvorky

Description

@piskvorky

Bug Metadata

  • Version of extract_msg: 0.36.1
  • Your python version: Python 3.8
  • How did you launch extract_msg?
    • My command line or
    • I used the extract_msg package

Describe the bug

Opening a message with extract_msg.openMsg(bytes) leads to the traceback below. Cannot share the raw MSG unfortunately.

Traceback

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/extract_msg/msg.py", line 180, in _ensureSet
    return getattr(self, variable)
AttributeError: 'MSGFile' object has no attribute '_classType'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/extract_msg/msg.py", line 553, in areStringsUnicode
    return self.__bStringsUnicode
AttributeError: 'MSGFile' object has no attribute '_MSGFile__bStringsUnicode'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/extract_msg/msg.py", line 720, in props
    return self._prop
AttributeError: 'MSGFile' object has no attribute '_prop'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/extract_msg/utils.py", line 603, in openMsg
    if not msg.classType:
  File "/usr/local/lib/python3.8/dist-packages/extract_msg/msg.py", line 649, in classType
    return self._ensureSet('_classType', '__substg1.0_001A')
  File "/usr/local/lib/python3.8/dist-packages/extract_msg/msg.py", line 183, in _ensureSet
    value = self._getStringStream(streamID)
  File "/usr/local/lib/python3.8/dist-packages/extract_msg/msg.py", line 301, in _getStringStream
    if self.areStringsUnicode:
  File "/usr/local/lib/python3.8/dist-packages/extract_msg/msg.py", line 555, in areStringsUnicode
    if self.props.has_key('340D0003'):
  File "/usr/local/lib/python3.8/dist-packages/extract_msg/msg.py", line 722, in props
    self._prop = Properties(self._getStream('__properties_version1.0'),
  File "/usr/local/lib/python3.8/dist-packages/extract_msg/properties.py", line 26, in __init__
    self.__len = len(data)
TypeError: object of type 'NoneType' has no len()

Metadata

Metadata

Labels

In ProgressThis issue or feature request has been confirmed or approved, respectively, and is being worked on.bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions