Skip to content

Allow running conjure-python-client on Windows#177

Open
schmelczer wants to merge 1 commit intodevelopfrom
asch/fix-windows
Open

Allow running conjure-python-client on Windows#177
schmelczer wants to merge 1 commit intodevelopfrom
asch/fix-windows

Conversation

@schmelczer
Copy link

Before this PR

TCP_KEEPINTVL and TCP_KEEPIDLE are not available in every Python build on Windows. Previously, TCP_KEEPINTVL was used unconditionally (crashing on Windows) and TCP_KEEPIDLE was only gated for macOS (also crashing on Windows.

See https://github.com/python/cpython/blob/b32c830d444c85421bd2c0c7af494c9d85485a29/Modules/socketmodule.c#L337-L340 which shows it's available from api version 16299.

Notably, the conda-forge builds of Python use a lower api version, I think it's because of their old Windows image (https://github.com/conda-forge/python-feedstock/blob/02184ce041a6bfa67e45fb2472a587ef13a99669/.azure-pipelines/azure-pipelines-win.yml#L8) but I'm not entirely sure.

After this PR

==COMMIT_MSG==
Allow running conjure-python-client on Windows
==COMMIT_MSG==

Only try accessing the properties if they're available.

@changelog-app
Copy link

changelog-app bot commented Feb 24, 2026

Generate changelog in changelog/@unreleased

Type (Select exactly one)

  • Feature (Adding new functionality)
  • Improvement (Improving existing functionality)
  • Fix (Fixing an issue with existing functionality)
  • Break (Creating a new major version by breaking public APIs)
  • Deprecation (Removing functionality in a non-breaking way)
  • Migration (Automatically moving data/functionality to a new system)

Description

Allow running conjure-python-client on Windows

Check the box to generate changelog(s)

  • Generate changelog entry

@changelog-app
Copy link

changelog-app bot commented Feb 24, 2026

Successfully generated changelog entry!

Need to regenerate?

Simply interact with the changelog bot comment again to regenerate these entries.


📋Changelog Preview

🐛 Fixes

  • Allow running conjure-python-client on Windows (#177)

import random
import requests
import socket
import sys
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was unused

Copy link
Contributor

@psyclaudeZ psyclaudeZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change LGTM, but I think the test is inconsistent now and we should probably patch it up.

from conjure_python_client._http.requests_client import (
ConjureHTTPError,
SOCKET_KEEP_ALIVE,
SOCKET_KEEP_INTVL,
TransportAdapter,
)

and

assert SOCKET_KEEP_ALIVE in socket_options
assert SOCKET_KEEP_INTVL in socket_options

Maybe use the same hasattr checks?

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.

3 participants