Windows: parse/verify fail with timeout wrapper (AttributeError on local function pickling)
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 52/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- python
调研方向
先从 math_verify.parse 和 math_verify.verify 使用的超时实现开始,然后在 Windows 上使用 Python 3.13 和 timeout_seconds=1 运行最小复现。跟踪 timeout wrapper 在 multiprocessing spawn 下是如何提交的。完成标准是:有效的 boxed 输入能够被解析,verify("4", "4", strict=True, timeout_seconds=1) 返回 True,并且失败不会被静默转换为空结果或假阴性。
由索引模型根据 Issue 内容生成。
描述
Summary
On Windows, math_verify.parse and math_verify.verify fail when timeout handling is enabled.
With default raise_on_error=False, failures are swallowed and parse returns [], which can
silently degrade correctness checks.
Environment
- OS: Windows 11
- Python: 3.13.3
- math-verify: 0.9.0
Minimal Repro
import math_verify
print(math_verify.parse(r"\\boxed{4}", raise_on_error=True))
print(math_verify.verify("4", "4", strict=True, timeout_seconds=1, raise_on_error=True))
Observed
AttributeError: Can't get local object 'timeout.<locals>.decorator.<locals>.wrapper.<locals>.run_func'
When raise_on_error=False (default):
math_verify.parse(...)returns[]math_verify.verify(...)returnsFalse
Related symptom sometimes appears from multiprocessing teardown on Windows:
OSError: [WinError 6] The handle is invalid
Expected
parseshould return parsed candidates for valid boxed/math strings.verify("4", "4", ...)should returnTrue.- Timeout handling should work (or fail loudly with a clear platform-specific message), rather than
silently returning empty parse results / false negatives.
Notes
The failure appears to be tied to the timeout implementation and Windows spawn multiprocessing,
where a local function used by the timeout wrapper is not picklable.
- 主要语言
- Python
- 星标
- 1.2k
- 派生
- 67
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
huggingface/Math-Verify 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
huggingface/Math-Verify#102 ·
-
verify() raises ValueError comparing chained relations of different length可能已有人在做 @chetana1410 于 8 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
huggingface/Math-Verify#93 ·
-
A period inside the math delimiters (`$\frac{1}{3}.$`) makes correct answers fail and can make wrong ones pass可能已有人在做 @MohammadHijjawi97 于 31 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 90/100
huggingface/Math-Verify#85 ·
-
evaluate_model_outputs.py: rows whose gold cannot be extracted are dropped from the accuracy denominator, so the printed accuracy disagrees with the is_correct column the script writes可能已有人在做 @shaurya416 于 36 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
huggingface/Math-Verify#83 ·
-
verify() rejects a not-equal written in the other order可能已有人在做 @chetana1410 于 7 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 35/100
huggingface/Math-Verify#100 ·
查看 huggingface/Math-Verify 的全部 Issue
相似的 Issue
-
good first issue test
难度 2/5 1-3 小时 新手友好度 85/100
ANCORATE/EncryptHome#8 ·
-
PluginProvider.storeInstance races and clobbers the dedup cache for concurrent loads可能已有人在做 @Wilson0511 今天认领。 未关闭needs-triage
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 2 天内回复
-
Bug: failed Together chat calls do not record operation duration or error.type可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
community documentation good first issue
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100