Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

msg_parser crashes when creating MxOxMessage. #126

Open
Dave-0-0 opened this issue Apr 13, 2020 · 0 comments
Open

msg_parser crashes when creating MxOxMessage. #126

Dave-0-0 opened this issue Apr 13, 2020 · 0 comments

Comments

@Dave-0-0
Copy link

  • msg_parser version: msg-parser-1.0.0 olefile-0.46
  • Python version: 2.7.17
  • Operating System: Ubuntu Linux 18.04

Ran the following Python code in an attempt to parse a .msg file. Tried with multiple different .msg files.

from msg_parser import MsOxMessage

msg_obj = MsOxMessage('./TEST.msg')

json_string = msg_obj.get_message_as_json()

I expected the email to be parsed into JSON. Instead MSG_Parser crashed when trying to create the MxOxMessage object.

Traceback (most recent call last):
File "parse.py", line 3, in
msg_obj = MsOxMessage('./TEST.msg')
File "/home/user/.local/lib/python2.7/site-packages/msg_parser/msg_parser.py", line 307, in init
self._message = Message(kids_dict)
File "/home/user/.local/lib/python2.7/site-packages/msg_parser/msg_parser.py", line 35, in init
self.properties = self._get_properties()
File "/home/user/.local/lib/python2.7/site-packages/msg_parser/msg_parser.py", line 124, in _get_properties
property_data = self._get_property_data(directory_name, directory_entry)
File "/home/user/.local/lib/python2.7/site-packages/msg_parser/msg_parser.py", line 217, in _get_property_data
property_value = self._data_model.get_value(raw_content, data_type=property_type)
File "/home/user/.local/lib/python2.7/site-packages/msg_parser/data_models.py", line 29, in get_value
value = getattr(self, self.data_type_name)(data_value)
File "/home/user/.local/lib/python2.7/site-packages/msg_parser/data_models.py", line 160, in PtypMultipleString
string_list.append(item_bytes.decode('utf-16-le'))
File "/usr/lib/python2.7/encodings/utf_16_le.py", line 16, in decode
return codecs.utf_16_le_decode(input, errors, True)
UnicodeDecodeError: 'utf16' codec can't decode byte 0x65 in position 0: truncated data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant