Skip to content
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

invalid mode ('wb') or filename (Windows) #4

Open
thBoo39 opened this issue Jan 21, 2018 · 1 comment
Open

invalid mode ('wb') or filename (Windows) #4

thBoo39 opened this issue Jan 21, 2018 · 1 comment

Comments

@thBoo39
Copy link

thBoo39 commented Jan 21, 2018

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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants