Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

persistent_local_browser broken on Windows: signal.SIGTERM and start_new_session are POSIX-only

未关闭
#58 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
72/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
冷清
技术栈
python
领域
tooling

调研方向

从 persistent_local_browser.py 中第 141-142 行附近的进程创建逻辑,以及第 187 行附近的 release 终止逻辑开始。检查 Windows 子进程行为和现有的 release 命令,然后验证 Chromium 会话在父进程退出后仍能存活,并且 release 能在不产生 AttributeError 的情况下终止它。

由索引模型根据 Issue 内容生成。

描述

Description

persistent_local_browser.py has two Windows incompatibilities that prevent the tool from working on Windows:

  1. signal.SIGTERM not available on Windows (line 187): os.kill(pid, signal.SIGTERM) raises AttributeError because signal.SIGTERM is a Unix-only constant. The release command crashes.

  2. start_new_session is POSIX-only (line 141-142): The process detach logic only applies on POSIX. On Windows, the Chromium subprocess is not detached from the parent, so it gets killed when the parent exits - making the "persistent" browser feature non-functional.

Impact

  • The entire persistent_local_browser tool is broken on Windows
  • _cmd_release crashes with AttributeError when trying to terminate a browser
  • Persistent browser sessions cannot outlive the creating script on Windows
  • Error message is a cryptic Python traceback, not a helpful diagnostic

Suggested Fix

Add Windows code paths:

  • For process detach: use creationflags=subprocess.CREATE_NEW_PROCESS_GROUP on Windows
  • For termination: use taskkill /F /T /PID on Windows as an alternative to os.kill(pid, signal.SIGTERM)
主要语言
Python
星标
6k
派生
385
PR 合并指标
30 天内没有已合并 PR

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/Webwright 的其他 Issue

查看 microsoft/Webwright 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。