[issue38417] Add support for settting umask in subprocess children

2019-10-12 Thread Gregory P. Smith
Gregory P. Smith added the comment: Now to see if the more esoteric config buildbots find any platform issues to address... -- resolution: -> fixed stage: patch review -> commit review status: open -> closed ___ Python tracker

[issue38417] Add support for settting umask in subprocess children

2019-10-12 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset f3751efb5c8b53b37efbbf75d9422c1d11c01646 by Gregory P. Smith in branch 'master': bpo-38417: Add umask support to subprocess (GH-16726) https://github.com/python/cpython/commit/f3751efb5c8b53b37efbbf75d9422c1d11c01646 --

[issue38417] Add support for settting umask in subprocess children

2019-10-12 Thread Gregory P. Smith
Change by Gregory P. Smith : -- keywords: +patch pull_requests: +16306 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/16726 ___ Python tracker

[issue38417] Add support for settting umask in subprocess children

2019-10-12 Thread Gregory P. Smith
Change by Gregory P. Smith : -- assignee: -> gregory.p.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38417] Add support for settting umask in subprocess children

2019-10-10 Thread Gregory P. Smith
Gregory P. Smith added the comment: preexec_fn has been mentally and advisability deprecated for years. :) I'll mark it officially with pending deprecation in 3.9 destined to be removed in 3.11. tracking that in its own rollup issue https://bugs.python.org/issue38435 As far as posix_spawn

[issue38417] Add support for settting umask in subprocess children

2019-10-10 Thread Christian Heimes
Christian Heimes added the comment: Changed in version 3.8: The preexec_fn parameter is no longer supported in subinterpreters. The use of the parameter in a subinterpreter raises RuntimeError. The new restriction may affect applications that are deployed in mod_wsgi, uWSGI, and other embedd

[issue38417] Add support for settting umask in subprocess children

2019-10-10 Thread Christian Heimes
Christian Heimes added the comment: preexec_fn does not work in subinterpreters, which (amongst others) affects mod_wsgi and similar WSGI implementations. Therefore portable software must not use preexec_fn at all. -- ___ Python tracker

[issue38417] Add support for settting umask in subprocess children

2019-10-10 Thread STINNER Victor
STINNER Victor added the comment: > We should not provide such an "run arbitrary python code before execing the > ultimate child" feature in the standard library. Do you want to modify _posixsubprocess to call umask() between fork() and exec()? As it has been done for uid, gid and groups: ca

[issue38417] Add support for settting umask in subprocess children

2019-10-10 Thread STINNER Victor
STINNER Victor added the comment: pylint emits a warning on subprocess.Popen(preexec_fn=func): W1509: Using preexec_fn keyword which may be unsafe in the presence of threads (subprocess-popen-preexec-fn) But not when using subprocess.run(preexec_fn=func). Maybe a check is missing in py

[issue38417] Add support for settting umask in subprocess children

2019-10-10 Thread STINNER Victor
STINNER Victor added the comment: > Another use of the deprecated unsafe preexec_fn was to call os.umask in the > child prior to exec. What do you mean by "deprecated"? The parameter doesn't seem to be deprecated in the documentation: https://docs.python.org/dev/library/subprocess.html#subpr

[issue38417] Add support for settting umask in subprocess children

2019-10-10 Thread Christian Heimes
Change by Christian Heimes : -- nosy: +christian.heimes ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https

[issue38417] Add support for settting umask in subprocess children

2019-10-09 Thread Gregory P. Smith
Gregory P. Smith added the comment: We should not provide such an "run arbitrary python code before execing the ultimate child" feature in the standard library. It is complicated, and assumes you have an ability to execute a new interpreter with its own slow startup time as an intermediate i

[issue38417] Add support for settting umask in subprocess children

2019-10-08 Thread STINNER Victor
STINNER Victor added the comment: > I'm trying to make sure we track what is blocking people from getting rid of > preexec_fn in their existing code so that we can actually deprecate and get > rid of the API entirely. If you consider posix_spawn(), I think that a convenient replacement for

[issue38417] Add support for settting umask in subprocess children

2019-10-08 Thread Gregory P. Smith
Gregory P. Smith added the comment: We don't have to for all possible things, doing this just reduced friction for existing uses. In this case, calling umask in our child ourselves would be easy to support. (easier than the more important setuid/sid/gid/groups-ish stuff that recently went

[issue38417] Add support for settting umask in subprocess children

2019-10-08 Thread STINNER Victor
STINNER Victor added the comment: > We should add an explicit feature for this If we need to write a wrapper program for that, I would say that no, we don't "have to" provide something in the stdlib. In OpenStack, I wrote prlimit.py which is a preexec-like wrapper program to apply resource

[issue38417] Add support for settting umask in subprocess children

2019-10-08 Thread Gregory P. Smith
New submission from Gregory P. Smith : Another use of the deprecated unsafe preexec_fn was to call os.umask in the child prior to exec. As seen in https://github.com/freeipa/freeipa/pull/3769 (see the code in there). We should add an explicit feature for this to avoid people's desire for pre