FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Inject `-nostdin` for non-piped `run_async` and update tests by bkupaccount · Pull Request #1 · bkupaccount/ffmpeg-python · GitHub

Inject -nostdin for non-piped run_async and update tests - #1

Open
bkupaccount wants to merge 1 commit into
masterfrom
codex/fix-console-input-issue-with-ffmpeg-python
Open

bkupaccount wants to merge 1 commit into
masterfrom
codex/fix-console-input-issue-with-ffmpeg-python

Conversation

Copy link
Copy Markdown
Owner

Motivation

  • Prevent ffmpeg child processes from attempting to read from the controlling TTY in non-piped mode (which can disrupt terminal echo/canonical modes) by applying the known -nostdin workaround in addition to using DEVNULL for subprocess stdin.
  • Preserve existing behavior when callers explicitly request stdin piping so pipe_stdin=True remains unchanged.

Description

  • In ffmpeg/_run.py, when pipe_stdin is False the compiled ffmpeg argument list is modified to insert '-nostdin' after the executable, and stdin remains subprocess.DEVNULL for the subprocess.
  • When pipe_stdin is True no -nostdin is injected and stdin stays as subprocess.PIPE.
  • Updated ffmpeg/tests/test_ffmpeg.py to expect the injected '-nostdin' only for the non-piped pipe_stdin=False cases and to expect stdin=subprocess.DEVNULL in that branch.

Testing

  • Ran a focused unittest.mock check that called ffmpeg.run_async with pipe_stdin=False and pipe_stdin=True and asserted that '-nostdin' is injected only in the non-piped case and that stdin is DEVNULL for non-piped and PIPE for piped, and that check passed.
  • Attempted to run the pytest selection with a temporary ffmpeg shim via pytest ffmpeg/tests/test_ffmpeg.py -k "run_async", but collection failed due to the environment missing the pytest-mock (mocker) fixture, so the pytest run could not execute.

Codex Task

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL