Skip to content

fix: avoid platform subprocess during OS detection - #1814

Open
nightcityblade wants to merge 1 commit into
anthropics:mainfrom
nightcityblade:fix/issue-1762-platform-header
Open

fix: avoid platform subprocess during OS detection#1814
nightcityblade wants to merge 1 commit into
anthropics:mainfrom
nightcityblade:fix/issue-1762-platform-header

Conversation

@nightcityblade

Copy link
Copy Markdown

Fixes #1762

Summary

  • replace platform.platform() with fork-free system, release, version, and machine queries
  • preserve macOS, iOS, and Android platform detection without resolving the lazy processor field
  • add regression coverage that fails if platform.platform() is called

Tests

  • uv run pytest -n0 tests/test_client.py (185 passed)
  • uv run ruff check src/anthropic/_base_client.py tests/test_client.py
  • uv run ruff format --check src/anthropic/_base_client.py tests/test_client.py
  • uv run pyright src/anthropic/_base_client.py tests/test_client.py
  • ./scripts/lint

@nightcityblade
nightcityblade requested a review from a team as a code owner August 9, 2026 03:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

First API request forks a subprocess via platform.platform() — child segfaults on macOS in long-running processes

1 participant