[issue32862] os.dup2(fd, fd, inheritable=False) behaves inconsistently

2021-03-20 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue32862] os.dup2(fd, fd, inheritable=False) behaves inconsistently

2021-03-20 Thread Eryk Sun


Change by Eryk Sun :


--
versions: +Python 3.10, Python 3.8, Python 3.9 -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



[issue32862] os.dup2(fd, fd, inheritable=False) behaves inconsistently

2018-02-17 Thread Alexey Izbyshev

Alexey Izbyshev  added the comment:

@eryksun: Thank you for the note! I've commented on #32865. This adds even more 
inconsistency to this corner case.

--

___
Python tracker 

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



[issue32862] os.dup2(fd, fd, inheritable=False) behaves inconsistently

2018-02-17 Thread Eryk Sun

Eryk Sun  added the comment:

In Windows the CRT file descriptor is actually still inheritable. This only 
makes the underlying OS handle non-inheritable. I don't think there's a way to 
make an existing FD non-inheritable using public CRT functions. See issue 32865.

--
nosy: +eryksun

___
Python tracker 

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



[issue32862] os.dup2(fd, fd, inheritable=False) behaves inconsistently

2018-02-16 Thread Alexey Izbyshev

Change by Alexey Izbyshev :


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

___
Python tracker 

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



[issue32862] os.dup2(fd, fd, inheritable=False) behaves inconsistently

2018-02-16 Thread Alexey Izbyshev

New submission from Alexey Izbyshev :

os.dup2(fd, fd, inheritable=False) may fail or change fd inheritability in 
following ways:

1) POSIX without F_DUP2FD_CLOEXEC
1.1) dup3() is available (a common case for Linux): OSError (EINVAL, dup3() 
doesn't allow equal descriptors)
1.2) dup3() is not available: fd made non-inheritable

2) POSIX with F_DUP2FD_CLOEXEC (FreeBSD): inheritability is not changed

3) Windows: fd made non-inheritable

In contrast, os.dup2(fd, fd, inheritable=True) never changes fd inheritability 
(same as before PEP 446 landed). I suggest to make os.dup2(fd, fd, 
inheritable=False) behave the same.

--
components: Extension Modules, Library (Lib)
messages: 312266
nosy: benjamin.peterson, izbyshev, vstinner
priority: normal
severity: normal
status: open
title: os.dup2(fd, fd, inheritable=False) behaves inconsistently
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