[issue32270] subprocess closes redirected fds even if they are in pass_fds

2018-09-11 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: Thank you, Gregory! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue32270] subprocess closes redirected fds even if they are in pass_fds

2018-09-11 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset 2173bb818c6c726d831b106ed0d3fad7825905dc by Gregory P. Smith (Miss Islington (bot)) in branch '3.6': bpo-32270: Don't close stdin/out/err in pass_fds (GH-6242) (GH-9149)

[issue32270] subprocess closes redirected fds even if they are in pass_fds

2018-09-10 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset 9c4a63fc17efea31ad41f90d28825be37469e0e2 by Gregory P. Smith (Miss Islington (bot)) in branch '3.7': bpo-32270: Don't close stdin/out/err in pass_fds (GH-6242) (GH-9148)

[issue32270] subprocess closes redirected fds even if they are in pass_fds

2018-09-10 Thread miss-islington
Change by miss-islington : -- pull_requests: +8595 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue32270] subprocess closes redirected fds even if they are in pass_fds

2018-09-10 Thread miss-islington
Change by miss-islington : -- pull_requests: +8596 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue32270] subprocess closes redirected fds even if they are in pass_fds

2018-09-10 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset ce34410b8b67f49d8275c05d51b3ead50cf97f48 by Gregory P. Smith in branch 'master': bpo-32270: Don't close stdin/out/err in pass_fds (GH-6242) https://github.com/python/cpython/commit/ce34410b8b67f49d8275c05d51b3ead50cf97f48 --

[issue32270] subprocess closes redirected fds even if they are in pass_fds

2018-04-11 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: An alternative fix is here: https://github.com/izbyshev/cpython/commit/b89b52f28490b69142d5c061604b3a3989cec66c Feel free to use the test if you don't like the approach :) -- ___ Python

[issue32270] subprocess closes redirected fds even if they are in pass_fds

2018-03-25 Thread Gregory P. Smith
Change by Gregory P. Smith : -- keywords: +patch pull_requests: +5977 stage: -> patch review ___ Python tracker ___

[issue32270] subprocess closes redirected fds even if they are in pass_fds

2018-03-25 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: Actually I've started to work on this with #32844, but got no feedback. This issue may of course be fixed independently, but the problems with descriptor ownership for fds <= 2 will remain unless all ownership problems are fixed at once.

[issue32270] subprocess closes redirected fds even if they are in pass_fds

2018-03-25 Thread Gregory P. Smith
Gregory P. Smith added the comment: This bug stems from: https://github.com/python/cpython/blob/master/Modules/_posixsubprocess.c#L454 When stdout=fd is passed, that results in c2pwrite=fd. The stdin/stdout/stderr pipe fds are closed when > 2 without checking to see if

[issue32270] subprocess closes redirected fds even if they are in pass_fds

2018-03-25 Thread Martin Panter
Change by Martin Panter : -- nosy: +martin.panter ___ Python tracker ___ ___

[issue32270] subprocess closes redirected fds even if they are in pass_fds

2017-12-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Regarding fixing (1), I'm worrying about backward compatibility a bit. Well, people shouldn't rely on bugs. Otherwise we would never be able to fix bugs, lest someone relies on it. -- ___ Python

[issue32270] subprocess closes redirected fds even if they are in pass_fds

2017-12-10 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: Regarding fixing (1), I'm worrying about backward compatibility a bit. Some people who discovered that behavior might rely on such "move" semantics and expect that the redirected descriptor is not leaked into the child. OTOH, since

[issue32270] subprocess closes redirected fds even if they are in pass_fds

2017-12-10 Thread Nitish
Change by Nitish : -- nosy: +nitishch ___ Python tracker ___ ___ Python-bugs-list

[issue32270] subprocess closes redirected fds even if they are in pass_fds

2017-12-10 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thanks for the report and the investigation! > 1. The fact that file descriptors specified for redirection are closed (even > with close_fds=False) unless in range [0, 2] is not documented and not tested. That sounds like a bug to me, so we

[issue32270] subprocess closes redirected fds even if they are in pass_fds

2017-12-10 Thread Alexey Izbyshev
New submission from Alexey Izbyshev : Demonstration: $ cat test.py import os import subprocess import sys fd = os.dup(sys.stdout.fileno()) subprocess.call([sys.executable, '-c', 'import sys;' 'print("Hello stdout");'