[New-bugs-announce] [issue36812] posix_spawnp returns error when used with file_actions

Matthew Tanous report at bugs.python.org
Mon May 6 11:03:31 EDT 2019


New submission from Matthew Tanous <mtanous22 at gmail.com>:

Ran into this on macOS while trying to play around with the new posix_spawn bindings. It appears to me that the file_actions path is not what is being used by file_actions here.  It may be that I am misunderstanding something, but I thought I would bring it up.

Python 3.8.0a3 (v3.8.0a3:9a448855b5, Mar 25 2019, 17:05:20)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> file_actions = [(os.POSIX_SPAWN_OPEN, 1, '.tmp/temp_file', os.O_CREAT | os.O_RDWR, 777)]
>>> os.posix_spawnp('whoami', ['whoami'], file_actions=file_actions)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: posix_spawnp() takes exactly 3 positional arguments (2 given)
>>> os.posix_spawnp('whoami', ['whoami'], os.environ, file_actions=file_actions)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
PermissionError: [Errno 13] Permission denied: 'whoami'

----------
components: Library (Lib)
messages: 341518
nosy: Matthew Tanous
priority: normal
severity: normal
status: open
title: posix_spawnp returns error when used with file_actions
type: behavior
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36812>
_______________________________________


More information about the New-bugs-announce mailing list