-
-
Notifications
You must be signed in to change notification settings - Fork 173
MSG read error This was probably caused by the time stamp being too far in the future. #427
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
Comments
It actually is from it being too far in the future, but it's a specific property that is too far. Let me write a quick patch to try and fix this |
When I say fix this, I mean the date provided is far beyond any of the known null dates, so I'm going to see if this number is meaningful in any way, and if not just make it so that null dates are formed for numbers beyond a certain point |
I've added a fix for this on the next-release branch. Feel free to test it, but it will be in the 0.49.0 update |
Fixed in version 0.49.0 |
Bug Metadata
*Version of extract_msg: [0.48.7]
*Your python version: Python [3.10]
*How did you launch extract_msg?
def outlook_meta(filename):
try:
msg = extract_msg.openMsg(filename, errorBehavior = extract_msg.enums.ErrorBehavior.SUPPRESS_ALL) #filename including path https://msg-extractor.readthedocs.io/en/stable/extract_msg.html
meta = "Subject:" + str(msg.subject) + " PERSON: From: " + str(msg.sender) + " To: " + str(msg.to)
if str(msg.cc) != "None": meta += " CC: " + str(msg.cc)
print(meta)
msg.close()
return (meta)
except Exception as e:
print("=================================Error Extract_Msg Person==================")
try:
msg.close()
except:
pass
return ("Error to Read File "+ str(e))
Describe the bug
[2024-08-02 07:28:06,394] [ ERROR] prop.py:201 - b'@\x00\x03\x80\x06\x00\x00\x00\x00\xcc\x0b\xf1\xbc\xff\xff\x1f'
Traceback (most recent call last):
File "C:\Users\z\AppData\Local\Programs\Python\Python310\lib\site-packages\extract_msg\utils.py", line 295, in filetimeToDatetime
return fromTimeStamp(filetimeToUtc(rawTime))
File "C:\Users\z\AppData\Local\Programs\Python\Python310\lib\site-packages\extract_msg\utils.py", line 347, in fromTimeStamp
return datetime.datetime.fromtimestamp(stamp, tz)
OSError: [Errno 22] Invalid argument
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\z\AppData\Local\Programs\Python\Python310\lib\site-packages\extract_msg\properties\prop.py", line 199, in _parseType
value = filetimeToDatetime(rawTime)
File "C:\Users\z\AppData\Local\Programs\Python\Python310\lib\site-packages\extract_msg\utils.py", line 300, in filetimeToDatetime
raise ValueError(f'Timestamp value of {filetimeToUtc(rawTime)} caused an exception. This was probably caused by the time stamp being too far in the future.')
ValueError: Timestamp value of 218939798520.0 caused an exception. This was probably caused by the time stamp being too far in the future.
[2024-08-02 07:28:06,472] [ ERROR] prop.py:201 - b'@\x00\x03\x80\x06\x00\x00\x00\x00\xcc\x0b\xf1\xbc\xff\xff\x1f'
Traceback (most recent call last):
File "C:\Users\z\AppData\Local\Programs\Python\Python310\lib\site-packages\extract_msg\utils.py", line 295, in filetimeToDatetime
return fromTimeStamp(filetimeToUtc(rawTime))
File "C:\Users\z\AppData\Local\Programs\Python\Python310\lib\site-packages\extract_msg\utils.py", line 347, in fromTimeStamp
return datetime.datetime.fromtimestamp(stamp, tz)
OSError: [Errno 22] Invalid argument
Additional context
The msg was send in 2010, so not in the future. It is not the isolated case, many msgs exported from this user raise the same flag.
The text was updated successfully, but these errors were encountered: