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 — os.PIDFD_NONBLOCK is missing, yet according to documentation it should be present · Issue #127583 · python/cpython

os.PIDFD_NONBLOCK is missing, yet according to documentation it should be present  #127583

New issue
Copy link
New issue
Copy link
Closed
Closed
os.PIDFD_NONBLOCK is missing, yet according to documentation it should be present #127583
Copy link
Labels
easyextension-modulesC modules in the Modules dirC modules in the Modules dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@Oleg-Deomidoff
Oleg-Deomidoff
opened on Dec 3, 2024
Issue body actions

Bug report

Bug description:

# Add a code block here, if required
import os
os.PIDFD_NONBLOCK

https://docs.python.org/3/library/os.html#os.PIDFD_NONBLOCK

python3.13 Wed 04 Dec 2024 01:57:39 AM +03
Python 3.13.0 (main, Oct 8 2024, 00:00:00) [GCC 14.2.1 20240912 (Red Hat 14.2.1-3)] on linux
Type "help", "copyright", "credits" or "license" for more information.

import os
os.PIDFD_NONBLOCK
Traceback (most recent call last):
File "", line 1, in
os.PIDFD_NONBLOCK
AttributeError: module 'os' has no attribute 'PIDFD_NONBLOCK'. Did you mean: 'EFD_NONBLOCK'?

CPython versions tested on:

3.13

Operating systems tested on:

Linux

Activity

  1. Oleg-Deomidoff
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Dec 3, 2024
  2. JelleZijlstra commented on Dec 3, 2024

    @JelleZijlstra
    JelleZijlstra
    on Dec 3, 2024
    Member
    More actions

    The docs say the constant is available on Linux >= 5.10.

    However, I can replicate this on a Linux system running kernel 5.15 using current main:

    $ uname -a
    Linux devshared41 5.15.0-1070-aws #76~20.04.1-Ubuntu SMP Mon Sep 2 12:20:36 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
    $ ./python -c 'import os; print(hasattr(os, "PIDFD_NONBLOCK"))'
    False
    

    The code looks correct:

    cpython/Modules/posixmodule.c

    Line 17410 in 12397a5

    #ifdef PIDFD_NONBLOCK

    And manpages confirm the constant should exist: https://man7.org/linux/man-pages/man2/pidfd_open.2.html

    Maybe we're missing an #include?

    cc @kumaraditya303 who added this in #93313

  3. stephen-hansen commented on Dec 4, 2024

    @stephen-hansen
    stephen-hansen
    on Dec 4, 2024
    Contributor
    More actions

    just browsing through here, looks like relevant kernel thread: https://lore.kernel.org/all/ZkrZb91EgZoaOybZ@t420/T/

    Seems like the missing #include is on <linux/pidfd.h>.

    Reacted by Jelle Zijlstra and Tomas R.
  4. picnixz
    added
    extension-modulesC modules in the Modules dirC modules in the Modules dir
    easy
    on Dec 5, 2024
  5. kumaraditya303 commented on Dec 6, 2024

    @kumaraditya303
    kumaraditya303
    on Dec 6, 2024
    Contributor
    More actions

    Fixed by #127593

  6. kumaraditya303
    closed this as completedon Dec 6, 2024
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

    easyextension-modulesC modules in the Modules dirC modules in the Modules dirtype-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.