invalid mode ('wb') or filename (Windows)
thBoo39 opened this issue · 1 comments
thBoo39 commented
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
samuel-b8 commented
same problem ;
if dt is None:
dt = datetime.utcnow()
dt = dt.isoformat()
dt = dt.replace(':','-')
also the json.dumps makes a str, so the with open(path, 'wb') as f: statement in to_json and from_json should be without the b option.