Tried: from dirtools import Dir, DirState d = Dir('myProject') dir_state = DirState(d) dir_state.to_json() IOError: [Errno 22] invalid mode ('wb') or filename. I'm using Windows. I believe the cause should be use of ':' in filename in .iosformat