williballenthin / EVTXtract

EVTXtract recovers and reconstructs fragments of EVTX log files from raw binary data, including unallocated space and memory images.
Apache License 2.0
189 stars 22 forks source link

datetime "is not JSON serializable" errors #6

Closed hiddenillusion closed 7 years ago

hiddenillusion commented 9 years ago
_Traceback_
datetime.datetime(2015, 1, 22, 20, 39, 18, 79180) is not JSON serializable
Traceback (most recent call last):
  File "EVTXtract\extract_lost_evtx_records.py", line 361, in extract_lost_evtx_records
    json.dumps(record["substitutions"])
 ...
  File "c:\python27\lib\json\encoder.py", line 184, in default
    raise TypeError(repr(o) + " is not JSON serializable")
TypeError: datetime.datetime(2015, 1, 22, 20, 39, 18, 969793) is not JSON serializable

Workaround Somewhat of a quick work around was to make the datetime objects strings in extract_lost_evtx_records.py's extract_root_substitutions() & extract_lost_record() . Note - this raises other errors in some debug logging in extract_lost_evtx_records.py & State.py when '.isoformat("T") + "Z"' is used.

williballenthin commented 7 years ago

I've recently rewritten much of EVTXtract to avoid bugs like these. Please retry on the latest version. This bug should be fixed.