
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2019-05-06 15:05 byMatthew Tanous, last changed2022-04-11 14:59 byadmin. This issue is nowclosed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 13144 | merged | anthonypjshaw,2019-05-06 23:10 | |
| Messages (7) | |||
|---|---|---|---|
| msg341522 -(view) | Author: Matthew Tanous (Matthew Tanous) | Date: 2019-05-06 15:05 | |
Allowing posix_spawn file_actions to default to None works, but explicitly setting it throws a TypeError:Python 3.8.0a3 (v3.8.0a3:9a448855b5, Mar 25 2019, 17:05:20)[Clang 6.0 (clang-600.0.57)] on darwinType "help", "copyright", "credits" or "license" for more information.>>> os.posix_spawnp('whoami', ['whoami'], os.environ, file_actions=None)Traceback (most recent call last): File "<stdin>", line 1, in <module>TypeError: file_actions must be a sequence or NoneThis required me to default to an empty sequence to complete it:>>> os.posix_spawnp('whoami', ['whoami'], os.environ, file_actions=[])6308 | |||
| msg341659 -(view) | Author: anthony shaw (anthonypjshaw)*![]() | Date: 2019-05-06 22:58 | |
Verified on masterPython 3.8.0a3+ (heads/bpo-28367:373c7aa098, May 6 2019, 17:34:39) [Clang 10.0.1 (clang-1001.0.46.4)] on darwinType "help", "copyright", "credits" or "license" for more information.>>> os.posix_spawnp('whoami', ['whoami'], os.environ, file_actions=None)Traceback (most recent call last): File "<stdin>", line 1, in <module>NameError: name 'os' is not defined>>> import os>>> os.posix_spawnp('whoami', ['whoami'], os.environ, file_actions=None)Traceback (most recent call last): File "<stdin>", line 1, in <module>TypeError: file_actions must be a sequence or None | |||
| msg341661 -(view) | Author: anthony shaw (anthonypjshaw)*![]() | Date: 2019-05-06 23:07 | |
Issue is in parse_file_actionsparse_file_actions(PyObject *file_actions, posix_spawn_file_actions_t *file_actionsp, PyObject *temp_buffer){ PyObject *seq; PyObject *file_action = NULL; PyObject *tag_obj; seq = v(file_actions, "file_actions must be a sequence or None"); if (seq == NULL) { return -1; }PySequence_Fast will raise a TypeError if PyObject_GetIter fails. | |||
| msg341663 -(view) | Author: anthony shaw (anthonypjshaw)*![]() | Date: 2019-05-06 23:10 | |
Raised a fix inGH-13144 | |||
| msg341664 -(view) | Author: anthony shaw (anthonypjshaw)*![]() | Date: 2019-05-06 23:14 | |
After patch:Python 3.8.0a3+ (heads/31968-dirty:c664b342a4, May 6 2019, 18:06:21) [Clang 10.0.1 (clang-1001.0.46.4)] on darwinType "help", "copyright", "credits" or "license" for more information.>>> import os>>> os.posix_spawnp('whoami', ['whoami'], os.environ, file_actions=None)17300>>> anthonyshaw | |||
| msg342036 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2019-05-10 02:00 | |
New changeset948ed8c96b6912541a608591efe3e00fb520429a by Victor Stinner (Anthony Shaw) in branch 'master':bpo-36814: ensure os.posix_spawn() handles None (GH-13144)https://github.com/python/cpython/commit/948ed8c96b6912541a608591efe3e00fb520429a | |||
| msg342038 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2019-05-10 02:01 | |
Matthew Tanous: Oops, I completely missed this case! Thanks for the bug report.Thanks Anthony Shaw for the fix. | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:59:14 | admin | set | github: 80995 |
| 2019-05-10 02:01:01 | vstinner | set | status: open -> closed resolution: fixed messages: +msg342038 stage: resolved |
| 2019-05-10 02:00:10 | vstinner | set | nosy: +vstinner messages: +msg342036 |
| 2019-05-09 23:29:44 | nanjekyejoannah | set | nosy: +nanjekyejoannah |
| 2019-05-06 23:14:02 | anthonypjshaw | set | messages: +msg341664 |
| 2019-05-06 23:10:51 | anthonypjshaw | set | messages: +msg341663 stage: patch review -> (no value) |
| 2019-05-06 23:10:19 | anthonypjshaw | set | keywords: +patch stage: patch review pull_requests: +pull_request13057 |
| 2019-05-06 23:07:06 | anthonypjshaw | set | assignee:anthonypjshaw messages: +msg341661 |
| 2019-05-06 22:58:56 | anthonypjshaw | set | nosy: +anthonypjshaw messages: +msg341659 |
| 2019-05-06 15:05:56 | Matthew Tanous | create | |