tsyesika/PyPump

"OSError: [Errno 2] No such file or directory" when creating the store on disk

Closed this issue · 5 comments

https://github.com/xray7224/PyPump/blob/master/pypump/store.py#L186

This line can raise an OSError with the rather cryptic message "[Errno 2] No such file or directory"

Looks like this error is raise when the parent dir (e.g. $HOME/.config) doesn't exist

We will also get a different OSError if we don't have permission to create the directory, however it's pretty clear on what the error was in that case.

A quick fix for the first error would be to use the recursive os.makedirs instead of os.mkdir

The second error is a little more obvious, so I don't think we should catch that one.

Test case done