Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(41149)

Side by Side Diff: Lib/pathlib.py

Issue 19921: Path.mkdir(0, True) always fails
Patch Set: Created 5 years, 9 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | Lib/test/test_pathlib.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 import fnmatch 1 import fnmatch
2 import functools 2 import functools
3 import io 3 import io
4 import ntpath 4 import ntpath
5 import os 5 import os
6 import posixpath 6 import posixpath
7 import re 7 import re
8 import sys 8 import sys
9 from collections import Sequence 9 from collections import Sequence
10 from contextlib import contextmanager 10 from contextlib import contextmanager
(...skipping 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after
1089 if self._closed: 1089 if self._closed:
1090 self._raise_closed() 1090 self._raise_closed()
1091 if not parents: 1091 if not parents:
1092 self._accessor.mkdir(self, mode) 1092 self._accessor.mkdir(self, mode)
1093 else: 1093 else:
1094 try: 1094 try:
1095 self._accessor.mkdir(self, mode) 1095 self._accessor.mkdir(self, mode)
1096 except OSError as e: 1096 except OSError as e:
1097 if e.errno != ENOENT: 1097 if e.errno != ENOENT:
1098 raise 1098 raise
1099 self.parent.mkdir(mode, True) 1099 self.parent.mkdir(parents=True)
1100 self._accessor.mkdir(self, mode) 1100 self._accessor.mkdir(self, mode)
1101 1101
1102 def chmod(self, mode): 1102 def chmod(self, mode):
1103 """ 1103 """
1104 Change the permissions of the path, like os.chmod(). 1104 Change the permissions of the path, like os.chmod().
1105 """ 1105 """
1106 if self._closed: 1106 if self._closed:
1107 self._raise_closed() 1107 self._raise_closed()
1108 self._accessor.chmod(self, mode) 1108 self._accessor.chmod(self, mode)
1109 1109
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
1272 # Path doesn't exist or is a broken symlink 1272 # Path doesn't exist or is a broken symlink
1273 # (see https://bitbucket.org/pitrou/pathlib/issue/12/) 1273 # (see https://bitbucket.org/pitrou/pathlib/issue/12/)
1274 return False 1274 return False
1275 1275
1276 1276
1277 class PosixPath(Path, PurePosixPath): 1277 class PosixPath(Path, PurePosixPath):
1278 __slots__ = () 1278 __slots__ = ()
1279 1279
1280 class WindowsPath(Path, PureWindowsPath): 1280 class WindowsPath(Path, PureWindowsPath):
1281 __slots__ = () 1281 __slots__ = ()
OLDNEW
« no previous file with comments | « no previous file | Lib/test/test_pathlib.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+