Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module os missing getppid() on PyPy 7.3.12 (Python 3.10.12 - Windows 10) #4024

Closed
gitlab-importer opened this issue Oct 30, 2023 · 5 comments

Comments

@gitlab-importer
Copy link

In Heptapod by @abhishek.sinha on Oct 30, 2023, 14:59

Hello, I have been trying out PyPy for a new project currently, and I noticed that os.getppid() function is missing on PyPy for Windows:

Python 3.10.12 (af44d0b8114cb82c40a07bb9ee9c1ca8a1b3688c, Jun 15 2023, 15:42:22)
[PyPy 7.3.12 with MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>> import os
>>>> os.getpid()
10744
>>>> os.getppid()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'os' has no attribute 'getppid'

Is this expected ? If I understand this right, the official CPython documentation states that it has been available on Windows since v 3.2:
https://docs.python.org/3/library/os.html#os.getppid

I have verified that it is included in CPython 3.11 on Windows.

Also, if there is a documentation of similar differences from CPython, it could help new comers to PyPy avoid such surprises.

Finally, thank you for a performance oriented Python implementation :)

@gitlab-importer
Copy link
Author

In Heptapod by @mattip on Oct 31, 2023, 04:44

Is this expected ?

No. Thanks for raising the issue. By doing the equivalent of import nt; print(dir(nt)) and then putting the results in a set and doing cpython ^ pypy I see PyPy is missing these:

{'_statfields', 'stat_float_times', 'getlogin', 'getppid', '_getdiskusage', \
 '_getvolumepathname', '_getfileinformation'}

@gitlab-importer
Copy link
Author

In Heptapod by @mattip on Oct 31, 2023, 09:10

I added getlogin and getppid in 49bc362df366. FWIW, we do have a compatibility page but this issue was an unintended oversight.

Closing, please reopen or open a new issue if the fix does not do what it is supposed to.

@gitlab-importer
Copy link
Author

In Heptapod by @abhishek.sinha on Oct 31, 2023, 10:18

Okay, thank you for a quick response & fix. I noticed the commit against branch/py3.9. May I know which upcoming binary build (Python 3.10+) can I expect to include this fix ?

@gitlab-importer
Copy link
Author

In Heptapod by @mattip on Oct 31, 2023, 10:48

I merged the fix into py3.10 too. Assuming it builds, you should be able to download a nightly build tomorrow from https://buildbot.pypy.org/nightly/py3.10/ (check the dates, you want a build from Nov 1 up).

@gitlab-importer
Copy link
Author

In Heptapod by @abhishek.sinha on Oct 31, 2023, 10:55

Alright, I'll do that. Thanks so much again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant