Skip to content

Windows: parse/verify fail with timeout wrapper (AttributeError on local function pickling) #79

Description

@rycerzes

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(...) returns False

Related symptom sometimes appears from multiprocessing teardown on Windows:

OSError: [WinError 6] The handle is invalid

Expected

  • parse should return parsed candidates for valid boxed/math strings.
  • verify("4", "4", ...) should return True.
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions