Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions Lib/_pyio.py
Original file line number Diff line number Diff line change
Expand Up @@ -1325,8 +1325,8 @@ def _flush_unlocked(self):
"should not raise BlockingIOError")
if n is None:
raise BlockingIOError(
errno.EAGAIN,
"write could not complete without blocking", 0)
"write could not complete without blocking",
characters_written=0)
if n > len(self._write_buf) or n < 0:
raise OSError("write() returned incorrect number of bytes")
del self._write_buf[:n]
Expand Down Expand Up @@ -1629,8 +1629,7 @@ def __init__(self, file, mode='r', closefd=True, opener=None):
self._stat_atopen = os.fstat(fd)
try:
if stat.S_ISDIR(self._stat_atopen.st_mode):
raise IsADirectoryError(errno.EISDIR,
os.strerror(errno.EISDIR), file)
raise IsADirectoryError(filename=file)
except AttributeError:
# Ignore the AttributeError if stat.S_ISDIR or errno.EISDIR
# don't exist.
Expand Down
3 changes: 1 addition & 2 deletions Lib/_pyrepl/terminfo.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Pure Python curses-like terminal capability queries."""

from dataclasses import dataclass, field
import errno
import os
from pathlib import Path
import re
Expand Down Expand Up @@ -151,7 +150,7 @@ def _read_terminfo_file(terminal_name: str) -> bytes:
if path.is_file():
return path.read_bytes()

raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), filename)
raise FileNotFoundError(filename=filename)


# Hard-coded terminal capabilities for common terminals
Expand Down
7 changes: 2 additions & 5 deletions Lib/multiprocessing/shared_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from functools import partial
import mmap
import os
import errno
import struct
import secrets
import types
Expand Down Expand Up @@ -143,10 +142,8 @@ def __init__(self, name=None, create=False, size=0, *, track=True):
if last_error_code == _winapi.ERROR_ALREADY_EXISTS:
if name is not None:
raise FileExistsError(
errno.EEXIST,
os.strerror(errno.EEXIST),
name,
_winapi.ERROR_ALREADY_EXISTS
filename=name,
winerror=_winapi.ERROR_ALREADY_EXISTS
)
else:
continue
Expand Down
2 changes: 1 addition & 1 deletion Lib/shutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -1245,7 +1245,7 @@ def make_archive(base_name, format, root_dir=None, base_dir=None, verbose=0,
root_dir = os.fspath(root_dir)
stmd = os.stat(root_dir).st_mode
if not stat.S_ISDIR(stmd):
raise NotADirectoryError(errno.ENOTDIR, 'Not a directory', root_dir)
raise NotADirectoryError(filename=root_dir)

if supports_root_dir:
kwargs['root_dir'] = root_dir
Expand Down
Loading