[issue29416] Path.mkdir can get into a recursive error loop

Eryk Sun report at bugs.python.org
Wed Feb 1 20:59:11 EST 2017


Eryk Sun added the comment:

This case is similar to issue 29079. It should only attempt to make the parent to handle ENOENT if self and self.parent aren't equal. Here's the snippet from Path.mkdir:

    try:
        self._accessor.mkdir(self, mode)
    except FileExistsError:
        if not exist_ok or not self.is_dir():
            raise
    except OSError as e:
        if e.errno != ENOENT:
            raise
        self.parent.mkdir(parents=True)
        self._accessor.mkdir(self, mode)

----------
nosy: +eryksun
stage:  -> needs patch
versions: +Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29416>
_______________________________________


More information about the Python-bugs-list mailing list