Skip to content

AI junk - #3784

Closed
tunglambk wants to merge 2 commits into
pallets:mainfrom
tunglambk:fix/lazy-file-fifo
Closed

AI junk#3784
tunglambk wants to merge 2 commits into
pallets:mainfrom
tunglambk:fix/lazy-file-fifo

Conversation

@tunglambk

Copy link
Copy Markdown

Fixes #2645

Lazy read-mode File parameters validated their path by opening and closing it during conversion. For a FIFO, that eager reader can consume the writer's data before the command accesses the lazy file.

Skip the eager open for FIFO paths while preserving it for regular readable paths. The regression test asserts that constructing a lazy FIFO reader does not open the FIFO, and the changelog records the behavior change.

Tests:

  • uv run pytest -q
  • uv run ruff check src/click/utils.py tests/test_utils/test_LazyFile.py
  • uv run ruff format --check src/click/utils.py tests/test_utils/test_LazyFile.py
  • uv run --group docs sphinx-build -E -W -b dirhtml docs docs/_build/dirhtml

@davidism

Copy link
Copy Markdown
Member

@davidism davidism closed this Aug 21, 2026
@davidism davidism added the rejected AI Contribution rejected because of its untrustworthy AI origin label Aug 21, 2026
@davidism davidism changed the title Avoid eagerly opening lazy FIFO reads AI junk Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rejected AI Contribution rejected because of its untrustworthy AI origin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Eager open/close of a LazyFile for error handling can make fifo reading fail

2 participants