Skip to content

readline_channel crashes with OverflowError when using the default timeout #2621

Description

@archy-rock3t-cloud

What happened (please include outputs or screenshots):

readline_channel (and readline_stdout/readline_stderr) default to timeout=None, which is converted to float("inf"). With no buffered line it calls update(), which multiplies the timeout by 1000 and passes it to select.poll().poll(). poll expects integer milliseconds and raises on infinity:

OverflowError: timestamp out of range for platform time_t

When a finite timeout expires, the method also falls through and returns None instead of the empty string/bytes the other read methods return.

What you expected to happen:

The default (no timeout) blocks until a line is available without crashing, and an expired timeout returns '' (or b'' in binary mode).

How to reproduce it (as minimally and precisely as possible):

import select
select.poll().poll(float("inf"))   # OverflowError

Environment:

  • Kubernetes version (kubectl version): n/a (client-side)
  • OS (e.g., MacOS 10.13.6): any platform where select.poll exists (Linux, macOS)
  • Python version (python --version): 3.12
  • Python client version (pip list | grep kubernetes): master

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions