Python 3.9 pidfd_open

Barry Scott barry at barrys-emacs.org
Fri Jul 8 11:21:00 EDT 2022



> On 5 Jul 2022, at 19:47, Weatherby,Gerard <gweatherby at uchc.edu> wrote:
> 
> python introduced os.pidfd_open(), which works as documented.
> 
> My development environment, PyCharm, complains about it being undefined.
> 
> Should it be in https://raw.githubusercontent.com/python/cpython/3.9/Lib/os.py ?

When faced with this type of problem I introspect from the Python REPL prompt.

Run python 3.9 and see if os.pidfd_open is defined?

Do not do this inside PyCharm to rule out a problem with PyCharm.

Also you will need to be running a linux kernel + glibc version that is new enough to proved this to python.

This is what I see with Fedora 36:

$ python3.9
Python 3.9.13 (main, Jun  9 2022, 00:00:00)
[GCC 12.1.1 20220507 (Red Hat 12.1.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
:>>> import os
:>>> os.pidfd_open
<built-in function pidfd_open>
:>>>

Barry


> 
> --
> Gerard Weatherby | Application Architect
> NMRbox | NAN | Department of Molecular Biology and Biophysics | UConn Health
> 263 Farmington Avenue, Farmington, CT 06030-6406
> uchc.edu<http://uchc.edu>
> -- 
> https://mail.python.org/mailman/listinfo/python-list
> 



More information about the Python-list mailing list