Skip to content

fix(sandbox: Suppress mypy attr-defined error on Windows for resource.setrlimit - #4

Merged
Abdurrafay19 merged 1 commit into
masterfrom
fix/mypy-windows-resource-stub
Sep 5, 2026
Merged

fix(sandbox: Suppress mypy attr-defined error on Windows for resource.setrlimit#4
Abdurrafay19 merged 1 commit into
masterfrom
fix/mypy-windows-resource-stub

Conversation

@Abdurrafay19

Copy link
Copy Markdown
Owner

This pull request improves the design, documentation, and robustness of the patchwork/tools/sandbox.py module, focusing on subprocess isolation, logging, and cross-platform compatibility. The most important changes are:

Design and Documentation Improvements:

  • Added a clear summary of design goals to the module docstring, emphasizing subprocess timeouts, use of temporary directories for generated code, output truncation to protect LLM context, and structured logging practices.

Code Robustness and Cross-platform Compatibility:

  • Updated the _limit_subprocess_memory function to include a type: ignore comment for mypy, clarifying that the resource module is only used on POSIX systems and ensuring type checking compatibility on Windows.

Code Organization:

  • Renamed the constants section header to "Tunables" for clarity and better organization.…etrlimit (Windows has no resource module)

@Abdurrafay19 Abdurrafay19 self-assigned this Sep 5, 2026
@Abdurrafay19 Abdurrafay19 added the bug Something isn't working label Sep 5, 2026
@Abdurrafay19
Abdurrafay19 merged commit 77e6398 into master Sep 5, 2026
1 of 4 checks passed
@Abdurrafay19
Abdurrafay19 deleted the fix/mypy-windows-resource-stub branch September 10, 2026 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant