Issue #19921: When Path.mkdir() is called with parents=True, any missing parent is created with the default permissions, ignoring the mode argument (mimicking the POSIX "mkdir -p" command).
Patch by Serhiy.
diff --git a/Lib/pathlib.py b/Lib/pathlib.py
index 9b4fde1..18facd9 100644
--- a/Lib/pathlib.py
+++ b/Lib/pathlib.py
@@ -1101,7 +1101,7 @@
except OSError as e:
if e.errno != ENOENT:
raise
- self.parent.mkdir(mode, True)
+ self.parent.mkdir(parents=True)
self._accessor.mkdir(self, mode)
def chmod(self, mode):