Skip to content

Conversation

@nanjekyejoannah
Copy link
Contributor

@nanjekyejoannah nanjekyejoannah commented Jan 14, 2019

I have exposed posix_spawnp.

Co-Author: Victor Stinner [email protected]

https://bugs.python.org/issue35674

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe write: f"status {status} != 0"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since I suggest use_posix_spawnp, I also suggest:

if (use_posix_spawnp) {
   ... posix_spawnp ...
}
else {
   ... posix_spawn ...
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The #ifdef must be outside [clinic start generated code].

I propose to reuse the existring #ifdef HAVE_POSIX_SPAWN, so don't add a new #ifdef HAVE_POSIX_SPAWN but just move the closing #endif /* HAVE_POSIX_SPAWN */ to include your new code.

Note: Currently, "make clinic" fails. Make sure that "make clinic" works as expected.

I bet that posix_spawnp() is always available when posix_spawn() is available. If it's not the case, we can fix that later.

@vstinner
Copy link
Member

AppVeyor build failed

That's because of the #ifdef issue, see my comment.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this line needs to be deleted to avoid confusing the argument clinic

@pablogsal
Copy link
Member

Very good job Joannah! :)

I left some comments together with Victor's review. Ping me when you have addressed them.

@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hum, you need to write a sentence. Something like:

Suggested change
:func:os.posix_spawnp
Add a new :func:`os.posix_spawnp` function. Patch by Joannah Nanjekye.

* Fix also indentation in posixmodule.c.
* Remove "if the *path* argument contains no directory" from
  os.posix_spawnp() doc
* Remove outdated comment from py_posix_spawn():
  /*[clinic end generated code: ...]*/
@vstinner vstinner dismissed serhiy-storchaka’s stale review January 16, 2019 13:19

Serhiy's comments have been addressed.

@vstinner
Copy link
Member

I checked Travis CI jobs. posix_spawnp is available on Linux and macOS jobs, but glibc is too old on the Linux for subprocess.

Linux:

# configure
checking for posix_spawn... yes
checking for posix_spawnp... yes

# pythoninfo
platform.libc_ver: glibc 2.19
subprocess._USE_POSIX_SPAWN: False

macOS:

# configure
checking for posix_spawn... yes
checking for posix_spawnp... yes

# pythoninfo
platform.platform: macOS-10.13.3-x86_64-i386-64bit
subprocess._USE_POSIX_SPAWN: True

@vstinner vstinner merged commit 92b8322 into python:master Jan 16, 2019
@vstinner
Copy link
Member

Well done @nanjekyejoannah :-) Thanks to Joannah for this nice enhancement and to all reviewers.

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

Successfully merging this pull request may close these issues.

6 participants