Use octal for mode defaults (#9670)

This commit is contained in:
Akuli
2023-02-03 21:12:53 +02:00
committed by GitHub
parent 48cffeeea6
commit 37a180ef7b
11 changed files with 17 additions and 17 deletions

View File

@@ -92,4 +92,4 @@ class _error(Exception): ...
error: tuple[type[_error], type[OSError]]
def whichdb(filename: str) -> str: ...
def open(file: str, flag: _TFlags = "r", mode: int = 438) -> _Database: ...
def open(file: str, flag: _TFlags = "r", mode: int = 0o666) -> _Database: ...

View File

@@ -29,4 +29,4 @@ class _Database(MutableMapping[_KeyType, bytes]):
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
) -> None: ...
def open(file: str, flag: str = "c", mode: int = 438) -> _Database: ...
def open(file: str, flag: str = "c", mode: int = 0o666) -> _Database: ...

View File

@@ -37,4 +37,4 @@ if sys.platform != "win32":
# Don't exist at runtime
__new__: None # type: ignore[assignment]
__init__: None # type: ignore[assignment]
def open(__filename: str, __flags: str = "r", __mode: int = 438) -> _gdbm: ...
def open(__filename: str, __flags: str = "r", __mode: int = 0o666) -> _gdbm: ...

View File

@@ -33,4 +33,4 @@ if sys.platform != "win32":
# Don't exist at runtime
__new__: None # type: ignore[assignment]
__init__: None # type: ignore[assignment]
def open(__filename: str, __flags: str = "r", __mode: int = 438) -> _dbm: ...
def open(__filename: str, __flags: str = "r", __mode: int = 0o666) -> _dbm: ...

View File

@@ -145,7 +145,7 @@ class CCompiler:
def shared_object_filename(self, basename: str, strip_dir: int = 0, output_dir: str = "") -> str: ...
def execute(self, func: Callable[..., object], args: tuple[Any, ...], msg: str | None = None, level: int = 1) -> None: ...
def spawn(self, cmd: list[str]) -> None: ...
def mkpath(self, name: str, mode: int = 511) -> None: ...
def mkpath(self, name: str, mode: int = 0o777) -> None: ...
def move_file(self, src: str, dst: str) -> str: ...
def announce(self, msg: str, level: int = 1) -> None: ...
def warn(self, msg: str) -> None: ...

View File

@@ -26,7 +26,7 @@ class Command:
def get_sub_commands(self) -> list[str]: ...
def warn(self, msg: str) -> None: ...
def execute(self, func: Callable[..., object], args: Iterable[Any], msg: str | None = None, level: int = 1) -> None: ...
def mkpath(self, name: str, mode: int = 511) -> None: ...
def mkpath(self, name: str, mode: int = 0o777) -> None: ...
def copy_file(
self, infile: str, outfile: str, preserve_mode: int = 1, preserve_times: int = 1, link: str | None = None, level: Any = 1
) -> tuple[str, bool]: ... # level is not used

View File

@@ -1,5 +1,5 @@
def mkpath(name: str, mode: int = 511, verbose: int = 1, dry_run: int = 0) -> list[str]: ...
def create_tree(base_dir: str, files: list[str], mode: int = 511, verbose: int = 1, dry_run: int = 0) -> None: ...
def mkpath(name: str, mode: int = 0o777, verbose: int = 1, dry_run: int = 0) -> list[str]: ...
def create_tree(base_dir: str, files: list[str], mode: int = 0o777, verbose: int = 1, dry_run: int = 0) -> None: ...
def copy_tree(
src: str,
dst: str,

View File

@@ -136,7 +136,7 @@ class FileFinder(importlib.abc.PathEntryFinder):
) -> Callable[[str], importlib.abc.PathEntryFinder]: ...
class SourceFileLoader(importlib.abc.FileLoader, importlib.abc.SourceLoader):
def set_data(self, path: str, data: ReadableBuffer, *, _mode: int = 438) -> None: ...
def set_data(self, path: str, data: ReadableBuffer, *, _mode: int = 0o666) -> None: ...
class SourcelessFileLoader(importlib.abc.FileLoader, importlib.abc.SourceLoader): ...

View File

@@ -604,7 +604,7 @@ if sys.platform != "win32" and sys.version_info >= (3, 11):
def login_tty(__fd: int) -> None: ...
def lseek(__fd: int, __position: int, __how: int) -> int: ...
def open(path: StrOrBytesPath, flags: int, mode: int = 511, *, dir_fd: int | None = None) -> int: ...
def open(path: StrOrBytesPath, flags: int, mode: int = 0o777, *, dir_fd: int | None = None) -> int: ...
def pipe() -> tuple[int, int]: ...
def read(__fd: int, __length: int) -> bytes: ...
@@ -707,15 +707,15 @@ def link(
follow_symlinks: bool = True,
) -> None: ...
def lstat(path: StrOrBytesPath, *, dir_fd: int | None = None) -> stat_result: ...
def mkdir(path: StrOrBytesPath, mode: int = 511, *, dir_fd: int | None = None) -> None: ...
def mkdir(path: StrOrBytesPath, mode: int = 0o777, *, dir_fd: int | None = None) -> None: ...
if sys.platform != "win32":
def mkfifo(path: StrOrBytesPath, mode: int = 438, *, dir_fd: int | None = None) -> None: ... # Unix only
def mkfifo(path: StrOrBytesPath, mode: int = 0o666, *, dir_fd: int | None = None) -> None: ... # Unix only
def makedirs(name: StrOrBytesPath, mode: int = 511, exist_ok: bool = False) -> None: ...
def makedirs(name: StrOrBytesPath, mode: int = 0o777, exist_ok: bool = False) -> None: ...
if sys.platform != "win32":
def mknod(path: StrOrBytesPath, mode: int = 384, device: int = 0, *, dir_fd: int | None = None) -> None: ...
def mknod(path: StrOrBytesPath, mode: int = 0o600, device: int = 0, *, dir_fd: int | None = None) -> None: ...
def major(__device: int) -> int: ...
def minor(__device: int) -> int: ...
def makedev(__major: int, __minor: int) -> int: ...

View File

@@ -99,7 +99,7 @@ class Path(PurePath):
def iterdir(self: Self) -> Generator[Self, None, None]: ...
def lchmod(self, mode: int) -> None: ...
def lstat(self) -> stat_result: ...
def mkdir(self, mode: int = 511, parents: bool = False, exist_ok: bool = False) -> None: ...
def mkdir(self, mode: int = 0o777, parents: bool = False, exist_ok: bool = False) -> None: ...
# Adapted from builtins.open
# Text mode: always returns a TextIOWrapper
# The Traversable .open in stdlib/importlib/abc.pyi should be kept in sync with this.
@@ -178,7 +178,7 @@ class Path(PurePath):
if sys.version_info >= (3, 10):
def hardlink_to(self, target: str | Path) -> None: ...
def touch(self, mode: int = 438, exist_ok: bool = True) -> None: ...
def touch(self, mode: int = 0o666, exist_ok: bool = True) -> None: ...
if sys.version_info >= (3, 8):
def unlink(self, missing_ok: bool = False) -> None: ...
else:

View File

@@ -184,7 +184,7 @@ class ZipFile:
compresslevel: int | None = None,
) -> None: ...
if sys.version_info >= (3, 11):
def mkdir(self, zinfo_or_directory_name: str | ZipInfo, mode: int = 511) -> None: ...
def mkdir(self, zinfo_or_directory_name: str | ZipInfo, mode: int = 0o777) -> None: ...
class PyZipFile(ZipFile):
def __init__(