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

Add comment and assertion to pidfd_open workaround #2799

Merged
merged 3 commits into from
Sep 17, 2023

Conversation

jakkdl
Copy link
Member

@jakkdl jakkdl commented Sep 16, 2023

EDIT: assumptions were wrong

Ended up researching this during discussion in #2792, and thought I might as well add a comment (and an assertion to double-check assumptions). Also cleared up a coverage miss for an error that shouldn't trigger in test runs.

One could possibly raise a warning instead of the assertion to be extra defensive, but afaict it really shouldn't trigger on 3.9+ so the assertion+message is already very defensive IMO.

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

@codecov
Copy link

codecov bot commented Sep 16, 2023

Codecov Report

Merging #2799 (4f17c57) into master (c16003f) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2799      +/-   ##
==========================================
+ Coverage   98.95%   98.97%   +0.01%     
==========================================
  Files         115      115              
  Lines       17011    17009       -2     
  Branches     3045     3044       -1     
==========================================
+ Hits        16833    16834       +1     
+ Misses        123      121       -2     
+ Partials       55       54       -1     
Files Changed Coverage Δ
trio/_subprocess.py 98.29% <100.00%> (+1.25%) ⬆️

@jakkdl
Copy link
Member Author

jakkdl commented Sep 16, 2023

Ah, turns out pypy doesn't have os.pidfd_open

@jakkdl jakkdl changed the title add assertion check to os.pidfd_open on linux in preparation for 3.8 deprecation Add comment and assertion to pidfd_open workaround Sep 16, 2023
@A5rocks
Copy link
Contributor

A5rocks commented Sep 16, 2023

-snip-

Never mind, this looks good. I forgot that our workaround will also only be available on Linux >=5.3 cause that's when the syscall is available

@jakkdl jakkdl merged commit a4f12b7 into python-trio:master Sep 17, 2023
@jakkdl jakkdl deleted the pidfd_open branch September 17, 2023 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants