Use `total_seconds` instead of `seconds` on timeout by Kludex · Pull Request #896 · modelcontextprotocol/python-sdk

Conversation

@Kludex

Since we accept timedelta, we are ignoring the other non-seconds fields, which shouldn't be the case.

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates timeout initialization by replacing the use of .seconds with .total_seconds() to account for the complete precision of timedelta values.

  • Update timeout in the streamable HTTP client for proper handling of timedelta fields
  • Replace seconds with total_seconds() for both default and read timeout values

samuelcolvin

Choose a reason for hiding this comment

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

Lgtm

@Kludex Kludex deleted the use-total-seconds-instead-of-seconds branch

June 7, 2025 20:11

3 participants

@Kludex @samuelcolvin