Skip to content

Tracker: CODESTYLE.md > Python #4100

Open

Description

@ptr727

Per-unit tracker for findings raised against this canonical unit by a carrying repository's review, per pr-review-conduct Merge Gate item 3.

Findings

  • Bound the wait after terminate() on a Popen child, with a kill() fallback. Raised by CodeRabbit on Resync the Instruction Set and Carried Skills With the Hub NxWitness#685, against the carried CODESTYLE.md "Interrupts in Python" at line 132, carried at the hub's main 2d0f8901. In the reviewer's words: "The rule waits without a bound after terminate(). A child that ignores SIGTERM can keep the script from printing its interrupt line or exiting with 143/130." It proposes wait(timeout=...), then kill() and a second wait on subprocess.TimeoutExpired. It notes that "Interrupts in Shell" has the same unbounded wait, which Bash cannot time out directly.

    • Not judged here. The carrier declined it under outcome 2, since the text is the hub's to change.
  • Install a SIGINT handler explicitly rather than relying on Python's default. Raised by CodeRabbit on Resync the Instruction Set and Skills Tree With the Hub PlexCleaner#1259, against the carried CODESTYLE.md "Interrupts in Python" first bullet, carried at the hub's main 009d3e5e. Python raises KeyboardInterrupt on SIGINT only where the parent did not start it with SIGINT ignored. A non-interactive shell starts a background command that way, so a script following the rule ignores SIGINT and skips its cleanup and its exit 130. It proposes that the entry point install handlers for both signals with signal.signal, each recording the signal and raising KeyboardInterrupt.

    • Not judged here. The carrier declined it under outcome 2, since the text is the hub's to change.
  • The bounded-wait finding above was raised again by CodeRabbit on Resync the Instruction Set and Skills Tree With the Hub PlexCleaner#1259, against the same bullet carried at 009d3e5e, again naming the Shell wait as well.

  • State the __enter__ window in the cleanup bullet. Raised by CodeRabbit on Promote Develop: Hub Resync to 009d3e5e and the .NET SDK Line PlexCleaner#1261, against the carried CODESTYLE.md "Interrupts in Python" bullet "What the script holds is released by with blocks and finally clauses as the exception unwinds", carried at 009d3e5e. A KeyboardInterrupt raised inside __enter__, after a resource is acquired and before the method returns, skips __exit__, so a lock or temporary path can stay held. It proposes limiting the claim to after __enter__ returns and naming the window as uncovered.

    • Not judged here. The carrier declined it under outcome 2, since the text is the hub's to change.

🤖 Generated with Claude Code

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions