Skip to content

[split] Refactor / cleanup — from #21#33

Closed
pull-apart[bot] wants to merge 1 commit into
mainfrom
split-pr-21-1783401787-refactor
Closed

[split] Refactor / cleanup — from #21#33
pull-apart[bot] wants to merge 1 commit into
mainfrom
split-pr-21-1783401787-refactor

Conversation

@pull-apart

@pull-apart pull-apart Bot commented Jul 7, 2026

Copy link
Copy Markdown

Automated split from #21.

Context

This is the refactor / cleanup half of an automated split from #21.

Changes in this PR:

  • utilities/console.py: Replaced usage of pexpect.spawn with pty.openpty() and subprocess.Popen for console process creation to avoid os.forkpty().
  • Added _spawn_console method to encapsulate pty pair creation, subprocess spawning, and pexpect.fdpexpect.fdspawn wrapping.
  • Added _terminate_proc method for graceful and forced shutdown of the console subprocess.
  • Modified Console class to store subprocess.Popen object in a new _proc attribute.
  • Updated connect method to use _spawn_console for console setup and call _terminate_proc on connection errors.
  • Updated disconnect method to check _proc status and ensure _terminate_proc is called during cleanup.
  • Simplified console_eof_sampler method signature by removing func, command, and timeout parameters.
  • Changed console_eof_sampler to internally call _spawn_console instead of a generic func.
  • Added imports for pty, shlex, subprocess, and pexpect.fdpexpect.
  • Updated TimeoutSampler import to include TimeoutExpiredError.
How this split maps your changes
  • Refactor branch (split-pr-21-1783401787-refactor): files classified as cleanup / mechanical work:
    • utilities/console.py
  • Main branch (split-pr-21-1783401787-main): files classified as feature / behavior work:
    • utilities/unittests/test_console.py

Merge order

Merge the refactor PR first if it touches shared files or would conflict with the main PR; then merge the main PR. Resolve conflicts in the usual way if both branches touch the same lines.

Main PR: #34

@RoniKishner

Copy link
Copy Markdown
Owner

@pull-apart /close

@RoniKishner RoniKishner closed this Jul 7, 2026
@RoniKishner RoniKishner deleted the split-pr-21-1783401787-refactor branch July 7, 2026 08:55
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