[issue33968] os.makedirs and empty string

2018-07-02 Thread Emily Morehouse
Change by Emily Morehouse : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Pytho

[issue33968] os.makedirs and empty string

2018-06-27 Thread Emily Morehouse
Emily Morehouse added the comment: The os.path conventions do follow, '' and '.' are not treated the same here either -- >>> os.path.exists('') False >>> os.path.exists('.') True >>> os.path.isdir('') False >>> os.path.isdir('.') True The only os.path function that I see as potentially confu

[issue33968] os.makedirs and empty string

2018-06-27 Thread Carl Andersson
Carl Andersson added the comment: That is in essence what I am looking for, yes. As you say, it's not pretty. My opinion is still that if the os.path convention is that '' is the same as '.', this should be respected. -- ___ Python tracker

[issue33968] os.makedirs and empty string

2018-06-26 Thread Emily Morehouse
Emily Morehouse added the comment: I'll defer to Serhiy's os.path expertise, but from what I know -- os.dirname is essentially a helper function for returning the first item of split. What I'm gathering is that you're looking for a more advanced way of parsing a file path -- say "nested/dir

[issue33968] os.makedirs and empty string

2018-06-26 Thread Carl Andersson
Carl Andersson added the comment: I can see the point in keeping the behaviour close to the OS-level commands, but the discrepancy between os.mkdir (or os.makedirs) and os.path.dirname is not resolved. I still think that >>> os.makedirs(os.path.dirname(filename), exist_ok=True) should be abl

[issue33968] os.makedirs and empty string

2018-06-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Concur with Emily. -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list maili

[issue33968] os.makedirs and empty string

2018-06-26 Thread Emily Morehouse
Emily Morehouse added the comment: This is an interesting behavior to note. I think the current behavior makes the most sense, as it corresponds to the OS-level errors that you get from running the same operations. Interestingly, at least on Unix-based file systems, we get different error me

[issue33968] os.makedirs and empty string

2018-06-26 Thread Carl Andersson
New submission from Carl Andersson : os.makedirs does not handle the empty string the same way as the os.path.XX functions does. This is (to me) unexpected behaviour, since calls like `os.makedirs(os.path.dirname(filename), exist_ok=True)` raises an exception if `filename` does not contain an