Skip to content
Open
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
16 changes: 12 additions & 4 deletions src/click/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,21 +117,27 @@ class LazyFile:
files for writing.
"""

name: str
mode: str
encoding: str | None
errors: str | None
atomic: bool
_f: t.IO[t.Any] | None
should_close: bool

def __init__(
self,
filename: str | os.PathLike[str],
mode: str = "r",
encoding: str | None = None,
errors: str | None = "strict",
atomic: bool = False,
):
self.name: str = os.fspath(filename)
) -> None:
self.name = os.fspath(filename)
self.mode = mode
self.encoding = encoding
self.errors = errors
self.atomic = atomic
self._f: t.IO[t.Any] | None
self.should_close: bool

if self.name == "-":
self._f, self.should_close = open_stream(filename, mode, encoding, errors)
Expand Down Expand Up @@ -508,6 +514,8 @@ class PacifyFlushWrapper:
pipe, all calls and attributes are proxied.
"""

wrapped: t.IO[t.Any]

def __init__(self, wrapped: t.IO[t.Any]) -> None:
self.wrapped = wrapped

Expand Down
Loading