Skip to content
Myr

Merge pull request #2036 from jcrotts/fix-windows-permission-pager

Before adoption: this commit came in with the history the project adopted, so no landing records it.

close temporary file used by echo_via_pager

authored by David Lord · committed by GitHub · parents 09b9d61, e892389 · Browse files · 1 file+2 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−1 removed

  • other:+2 added−1 removed

1 file+2 added−1 removed

modified:src/click/_termui_impl.py+2 added-1 removed
424 unmodified lines
425) -> None:426 """Page through text by invoking a program on a temporary file."""427 import tempfile428429 _, filename = tempfile.mkstemp()429 fd, filename = tempfile.mkstemp()430 # TODO: This never terminates if the passed generator never terminates.431 text = "".join(generator)432 if not color:433 text = strip_ansi(text)
2 unmodified lines
436 f.write(text.encode(encoding))437 try:438 os.system(f'{cmd} "{filename}"')439 finally:440 os.close(fd)441 os.unlink(filename)442443444def _nullpager(
274 unmodified lines