GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — selectmodule.c: errno < 0 comparison is always false · Issue #146205 · python/cpython

selectmodule.c: errno < 0 comparison is always false #146205

New issue
Copy link
New issue
Copy link
Closed
Closed
selectmodule.c: errno < 0 comparison is always false#146205
Copy link
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@aisk
aisk
opened on Mar 20, 2026
Issue body actions

Bug report

Bug description:

Summary

Multiple sites in Modules/selectmodule.c check if (errno < 0) after close/epoll_ctl calls. Since errno is an int set to positive values (POSIX), this check is always false. Close errors are silently swallowed.

Fix

Change if (errno < 0) to if (retval < 0) (check the return value, not errno directly).

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

  • gh-146205: Check the errno with != 0 in close impls in select module #146206

Activity

  1. aisk
    added a parent issue on Mar 20, 2026
    • Umbrella issue: bugs found using cpython-review-toolkit #146102
  2. aisk
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Mar 20, 2026
  3. vstinner
    added a commit that references this issue on Mar 20, 2026

    gh-146205: Check the errno with != 0 in close impls in select module (#…

    9f9faa2
  4. vstinner
    closed this as completedon Mar 20, 2026
  5. CuriousLearner
    added a commit that references this issue on Mar 22, 2026

    Merge remote-tracking branch 'upstream/main' into fix-pythongh-138577

    2691ad9
  6. ljfp
    added a commit that references this issue on Apr 25, 2026

    pythongh-146205: Check the errno with != 0 in close impls in select m…

    fa7d654
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.