This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2019年01月07日 00:46 by vstinner, last changed 2022年04月11日 14:59 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 11545 | closed | python-dev, 2019年01月13日 21:27 | |
| PR 11545 | closed | python-dev, 2019年01月13日 21:27 | |
| PR 11545 | closed | python-dev, 2019年01月13日 21:27 | |
| PR 11545 | closed | python-dev, 2019年01月13日 21:27 | |
| PR 11554 | merged | nanjekyejoannah, 2019年01月14日 14:10 | |
| PR 11554 | merged | nanjekyejoannah, 2019年01月14日 14:10 | |
| PR 11554 | merged | nanjekyejoannah, 2019年01月14日 14:10 | |
| Messages (11) | |||
|---|---|---|---|
| msg333128 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2019年01月07日 00:46 | |
bpo-20104 exposed os.posix_spawn(), but not os.posix_spawnp(). os.posix_spawnp() would be useful to support executable with no directory. See bpo-35537 "use os.posix_spawn in subprocess". I'm not sure what is the best API: * Add os.posix_spawnp()? duplicate the documentation and some parts of the C code (but share most of the C code) * Add a new optional parameter to os.posix_spawn()? Ideas of names: 'use_path' or 'search_executable'. Internally, the glibc uses SPAWN_XFLAGS_USE_PATH flag to distinguish posix_spawn() and posix_spawnp(). execvp() uses the PATH environment variable, or use confstr(_CS_PATH) if PATH is not set. I guess that posix_spawnp() also uses confstr(_CS_PATH) if PATH is not set. Currently, my favorite option is to add a new optional 'use_path' parameter to the existing os.posix_spawn() function. |
|||
| msg333130 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2019年01月07日 00:49 | |
Historically, Python used to mimick the libc: there are os.stat() and os.lstat() for example. But later, os.stat(*, follow_symlinks=False) keyword-only parameter has been added: if true, lstat() is used internally. |
|||
| msg333142 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2019年01月07日 08:19 | |
To add some context, the follow_symlinks parameter was added to os.stat() after adding support of *at() functions (like openat() and fstatat()). Since both C functions stat() and lstat() are superseded by fstatat(), the latter was exposed at Python level as adding new keyword-only parameters to os.stat(). This allowed to avoid significant increasing the number of functions in the os module. Since there is no function that supersedes both posix_spawn() and posix_spawnp(), this may be an argument for exposing them as separate functions at Python level. Although this argument is not very strong. |
|||
| msg333212 - (view) | Author: Joannah Nanjekye (nanjekyejoannah) * (Python committer) | Date: 2019年01月08日 08:36 | |
I would go with exposing posix_spawnp() as a separate function to rule out any arguments. I am working on this in this regard unless anyone has a different view. |
|||
| msg333225 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2019年01月08日 11:51 | |
I'm ok to expose posix_spawnp() as os.posix_spawnp(). Even if we expose posix_spawnp() as os.posix_spawnp(), we can still reconsider to add posix_spawnp() feature into os.posix_spawn() as an optional keyword parameter later :-) Honestly, I have no strong preference for the API. My main problem with the keyword option is the risk of name conflict if a new feature is added to posix_spawn() with a name similar to my proposed name "use_path". |
|||
| msg333346 - (view) | Author: Pablo Galindo Salgado (pablogsal) * (Python committer) | Date: 2019年01月09日 21:55 | |
I also think to expose posix_spawnp() as os.posix_spawnp() seems the more consistent thing to do as the os/posix module tries to mirror glibc as much as possible, which helps with discoverability and cross-reference with man pages. |
|||
| msg333347 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2019年01月09日 21:56 | |
Pablo: > I also think to expose posix_spawnp() as os.posix_spawnp() seems the more consistent thing to do as the os/posix module tries to mirror glibc as much as possible, which helps with discoverability and cross-reference with man pages. Ok. Let's do that. @Joannah Nanjekye: Don't hesitate to come to me if you need my help to implement that ;-) |
|||
| msg333375 - (view) | Author: Joannah Nanjekye (nanjekyejoannah) * (Python committer) | Date: 2019年01月10日 12:27 | |
Now that there is consesus, I am working on a PR for this. |
|||
| msg333767 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2019年01月16日 13:29 | |
New changeset 92b8322e7ea04b239cb1cb87b78d952f13ddfebb by Victor Stinner (Joannah Nanjekye) in branch 'master': bpo-35674: Add os.posix_spawnp() (GH-11554) https://github.com/python/cpython/commit/92b8322e7ea04b239cb1cb87b78d952f13ddfebb |
|||
| msg333772 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2019年01月16日 14:33 | |
Well done Joannah Nanjekye :-) Thanks to Joannah for this nice enhancemenet and to all reviewers. |
|||
| msg333773 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2019年01月16日 14:34 | |
FYI I modified subprocess to use os.posix_spawnp() when it's available: New changeset 07858894689047c77f9c12ddc061d30681368d19 by Victor Stinner in branch 'master': bpo-35537: subprocess can now use os.posix_spawnp (GH-11579) https://github.com/python/cpython/commit/07858894689047c77f9c12ddc061d30681368d19 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:59:10 | admin | set | github: 79855 |
| 2019年01月16日 14:34:00 | vstinner | set | keywords:
patch, patch, patch, patch messages: + msg333773 |
| 2019年01月16日 14:33:10 | vstinner | set | status: open -> closed messages: + msg333772 keywords: patch, patch, patch, patch resolution: fixed stage: patch review -> resolved |
| 2019年01月16日 13:29:30 | vstinner | set | messages: + msg333767 |
| 2019年01月14日 14:10:42 | nanjekyejoannah | set | pull_requests: + pull_request11189 |
| 2019年01月14日 14:10:34 | nanjekyejoannah | set | pull_requests: + pull_request11188 |
| 2019年01月14日 14:10:26 | nanjekyejoannah | set | pull_requests: + pull_request11187 |
| 2019年01月13日 21:27:47 | python-dev | set | keywords:
+ patch stage: patch review pull_requests: + pull_request11160 |
| 2019年01月13日 21:27:36 | python-dev | set | keywords:
+ patch stage: (no value) pull_requests: + pull_request11161 |
| 2019年01月13日 21:27:26 | python-dev | set | keywords:
+ patch stage: (no value) pull_requests: + pull_request11159 |
| 2019年01月13日 21:27:16 | python-dev | set | keywords:
+ patch stage: (no value) pull_requests: + pull_request11158 |
| 2019年01月13日 16:47:15 | izbyshev | set | nosy:
+ izbyshev |
| 2019年01月10日 12:27:10 | nanjekyejoannah | set | messages: + msg333375 |
| 2019年01月09日 21:56:30 | vstinner | set | messages: + msg333347 |
| 2019年01月09日 21:55:38 | pablogsal | set | messages: + msg333346 |
| 2019年01月08日 11:51:18 | vstinner | set | messages: + msg333225 |
| 2019年01月08日 08:36:28 | nanjekyejoannah | set | nosy:
+ nanjekyejoannah messages: + msg333212 |
| 2019年01月07日 08:19:15 | serhiy.storchaka | set | messages: + msg333142 |
| 2019年01月07日 00:49:10 | vstinner | set | messages: + msg333130 |
| 2019年01月07日 00:46:08 | vstinner | create | |