Skip to content

fix: handle bytes output when commands time out - #7

Open
harshitethic wants to merge 2 commits into
mainfrom
fix/timeout-output-bytes
Open

harshitethic wants to merge 2 commits into
mainfrom
fix/timeout-output-bytes

Conversation

@harshitethic

Copy link
Copy Markdown
Owner

Problem

subprocess.TimeoutExpired.stdout may be bytes even when the subprocess was started in text mode. The timeout handler concatenated that value directly with a string, so a timed-out command that had already produced output could raise TypeError instead of returning PatchPilot's normal timeout result.

Fix

  • normalize captured timeout output to text before appending the timeout marker
  • preserve the existing return code 124
  • add a focused regression test using byte output from TimeoutExpired

This keeps timeout failures reportable instead of turning them into backend errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant