[New-bugs-announce] [issue33968] os.makedirs and empty string

Carl Andersson report at bugs.python.org
Tue Jun 26 08:01:22 EDT 2018


New submission from Carl Andersson <carl.ande at icloud.com>:

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 any directories.
Also, it raises an `FileNotFoundError` regardless of the `exist_ok` flag. I would expect `os.makedirs('')` to fail with `FileExistsError` and `os.makedirs('', exist_ok=True)` to not do anything.

----------
components: Library (Lib)
messages: 320486
nosy: CarlAndersson
priority: normal
severity: normal
status: open
title: os.makedirs and empty string
type: behavior
versions: Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33968>
_______________________________________


More information about the New-bugs-announce mailing list