Skip to content

sys.stdin.read() throws a TypeError when stdin is set to be non-blocking #109523

Closed
@MartinHHProbst

Description

@MartinHHProbst

Bug report

Bug description:

sys.stdin.read() throws a TypeError if stdin has been set to be non-blocking. The code below should just exit without issue. It throws a TypeError if no input is provided.

#!/usr/bin/python3

import sys
import os

os.set_blocking(sys.stdin.fileno(), False)
sys.stdin.read()

CPython versions tested on:

3.11

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions