STINNER Victor <vstin...@python.org> 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#subprocess.Popen

And when I use it, it doesn't emit any warning:
---
import os, subprocess, sys
def func(): print(f"func called in {os.getpid()}")
argv = [sys.executable, "-c", "pass"]
print(f"parent: {os.getpid()}")
subprocess.run(argv, preexec_fn=func)
---

Output:
---
$ ./python -Werror x.py 
parent: 22264
func called in 22265
---

If you want to deprecate it, it should be documented as deprecated and emit a 
DeprecatedWarning, no?

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue38417>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to