[issue32844] subprocess may incorrectly redirect a low fd to stderr if another low fd is closed

2018-03-26 Thread Alexey Izbyshev

Change by Alexey Izbyshev :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32844] subprocess may incorrectly redirect a low fd to stderr if another low fd is closed

2018-03-26 Thread miss-islington

miss-islington  added the comment:


New changeset 57db13e582ad269d6e067fe934122207cc992739 by Miss Islington (bot) 
in branch '3.6':
bpo-32844: Fix a subprocess misredirection of a low fd (GH5689)
https://github.com/python/cpython/commit/57db13e582ad269d6e067fe934122207cc992739


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32844] subprocess may incorrectly redirect a low fd to stderr if another low fd is closed

2018-03-26 Thread miss-islington

miss-islington  added the comment:


New changeset 05455637f3ba9bacd459700f4feab783e5967d69 by Miss Islington (bot) 
in branch '3.7':
bpo-32844: Fix a subprocess misredirection of a low fd (GH5689)
https://github.com/python/cpython/commit/05455637f3ba9bacd459700f4feab783e5967d69


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32844] subprocess may incorrectly redirect a low fd to stderr if another low fd is closed

2018-03-26 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5989

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32844] subprocess may incorrectly redirect a low fd to stderr if another low fd is closed

2018-03-26 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5988

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32844] subprocess may incorrectly redirect a low fd to stderr if another low fd is closed

2018-03-26 Thread Gregory P. Smith

Gregory P. Smith  added the comment:


New changeset 0e7144b064a19493a146af94175a087b3888c37b by Gregory P. Smith 
(Alexey Izbyshev) in branch 'master':
bpo-32844: Fix a subprocess misredirection of a low fd (GH5689)
https://github.com/python/cpython/commit/0e7144b064a19493a146af94175a087b3888c37b


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32844] subprocess may incorrectly redirect a low fd to stderr if another low fd is closed

2018-02-14 Thread Alexey Izbyshev

Alexey Izbyshev  added the comment:

Note that the PR doesn't attempt to fix leaking of low dup'ed fds to the child. 
I'll file a separate report for that in a while.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32844] subprocess may incorrectly redirect a low fd to stderr if another low fd is closed

2018-02-14 Thread Alexey Izbyshev

Change by Alexey Izbyshev :


--
keywords: +patch
pull_requests: +5482
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32844] subprocess may incorrectly redirect a low fd to stderr if another low fd is closed

2018-02-14 Thread Alexey Izbyshev

New submission from Alexey Izbyshev :

When redirecting, subprocess attempts to achieve the following state: each fd 
to be redirected to is less than or equal to the fd it is redirected from, 
which is necessary because redirection occurs in the ascending order of 
destination descriptors. It fails to do so if a low fd (< 2) is redirected to 
stderr and another low fd is closed, which may lead to an incorrect 
redirection, for example:

$ cat test.py
import os
import subprocess
import sys

os.close(0)

subprocess.call([sys.executable, '-c',
 'import sys; print("Hello", file=sys.stderr)'],
stdin=2,
stderr=1)

$ python3 test.py 2>/dev/null
$ python3 test.py >/dev/null
Hello

Expected behavior:
$ python3 test.py >/dev/null
$ python3 test.py 2>/dev/null
Hello

--
components: Extension Modules, Library (Lib)
messages: 312181
nosy: gregory.p.smith, izbyshev
priority: normal
severity: normal
status: open
title: subprocess may incorrectly redirect a low fd to stderr if another low fd 
is closed
type: behavior
versions: Python 3.6, Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com