Skip to content

Commit

Permalink
Merge pull request #8 from TheElementalOfDestruction/fix-msg-support
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleKing authored Dec 4, 2024
2 parents aa8eb5b + 7096fd9 commit 5b55f5c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion textract/parsers/msg_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
def ensure_bytes(string):
"""Normalize string to bytes.
`ExtractMsg.Message._getStringStream` can return unicode or bytes depending
`extract_msg.Message._getStringStream` can return unicode or bytes depending
on what is originally stored in message file.
This helper functon makes sure, that bytes type is returned.
"""
if isinstance(string, six.string_types):
return string.encode('utf-8')
if string is None:
return b''
return string


Expand Down

0 comments on commit 5b55f5c

Please sign in to comment.