Bug Metadata
- Version of extract_msg: [0.41.5]
- Your python version: Python [3.9.15]
- How did you launch extract_msg?
Describe the bug
Is there a reason why extract_msg.signed_attachment.save() returns back the Message object instead of null or the path to the written file?
| else: |
| ifkwargs.get('extractEmbedded', False): |
| with_open(str(fullFilename), mode) asf: |
| # We just use the data we were given for this one. |
| f.write(self.__asBytes) |
| else: |
| self.saveEmbededMessage(**kwargs) |
| |
| # Close the ZipFile if this function created it. |
| if_zipandcreatedZip: |
| _zip.close() |
| |
| returnself.msg |
**What code did you use or can we use to reproduce this error?
try:
ret_value=attachment.save(customPath=self.working_directory,
customFilename=customFilename, extractEmbedded=True)
exceptException:
continueifisinstance(attachment, extract_msg.signed_attachment.SignedAttachment):
attachment_name=os.path.basename(ret_value)
attachment_path=ret_value
Traceback
File "/var/lib/assemblyline/.local/lib/python3.9/site-packages/assemblyline_v4_service/common/base.py", line 169, in handle_task
self.execute(request)
File "/opt/al_service/emlparser/emlparser.py", line 50, in execute
self.handle_outlook(request)
File "/opt/al_service/emlparser/emlparser.py", line 167, in handle_outlook
attachment_name = os.path.basename(ret_value)
File "/usr/local/lib/python3.9/posixpath.py", line 142, in basename
p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not MessageSigned
Additional context
self.type == AttachmentType.SIGNED
Bug Metadata
Describe the bug
Is there a reason why
extract_msg.signed_attachment.save()returns back the Message object instead of null or the path to the written file?msg-extractor/extract_msg/signed_attachment.py
Lines 167 to 179 in 3cffc2e
**What code did you use or can we use to reproduce this error?
Traceback
Additional context
self.type == AttachmentType.SIGNED