bpo-38435: Detect preexec_fn=os.setsid as start_new_session=True
This is a somewhat common use case, this makes it more reliable.
This commit is contained in:
parent
c6c43b2874
commit
9d365ba4b3
|
@ -937,6 +937,10 @@ class Popen(object):
|
||||||
if uid < 0:
|
if uid < 0:
|
||||||
raise ValueError(f"User ID cannot be negative, got {uid}")
|
raise ValueError(f"User ID cannot be negative, got {uid}")
|
||||||
|
|
||||||
|
if preexec_fn == os.setsid: # A common unnecessary legacy use.
|
||||||
|
start_new_session = True
|
||||||
|
preexec_fn = None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if p2cwrite != -1:
|
if p2cwrite != -1:
|
||||||
self.stdin = io.open(p2cwrite, 'wb', bufsize)
|
self.stdin = io.open(p2cwrite, 'wb', bufsize)
|
||||||
|
|
Loading…
Reference in New Issue