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

Delta Between Two Patch Sets: Lib/pathlib.py

Issue 19921: Path.mkdir(0, True) always fails
Left Patch Set: Created 5 years, 9 months ago
Right 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | Lib/test/test_pathlib.py » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 # set write and list permission bits for owner 1099 self.parent.mkdir(parents=True)
1100 self.parent.mkdir(mode | 0o300, True)
1101 self._accessor.mkdir(self, mode) 1100 self._accessor.mkdir(self, mode)
1102 1101
1103 def chmod(self, mode): 1102 def chmod(self, mode):
1104 """ 1103 """
1105 Change the permissions of the path, like os.chmod(). 1104 Change the permissions of the path, like os.chmod().
1106 """ 1105 """
1107 if self._closed: 1106 if self._closed:
1108 self._raise_closed() 1107 self._raise_closed()
1109 self._accessor.chmod(self, mode) 1108 self._accessor.chmod(self, mode)
1110 1109
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
1273 # Path doesn't exist or is a broken symlink 1272 # Path doesn't exist or is a broken symlink
1274 # (see https://bitbucket.org/pitrou/pathlib/issue/12/) 1273 # (see https://bitbucket.org/pitrou/pathlib/issue/12/)
1275 return False 1274 return False
1276 1275
1277 1276
1278 class PosixPath(Path, PurePosixPath): 1277 class PosixPath(Path, PurePosixPath):
1279 __slots__ = () 1278 __slots__ = ()
1280 1279
1281 class WindowsPath(Path, PureWindowsPath): 1280 class WindowsPath(Path, PureWindowsPath):
1282 __slots__ = () 1281 __slots__ = ()
LEFTRIGHT

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