[issue21384] Windows: Make handle non inheritable by default

2014-05-12 Thread STINNER Victor

STINNER Victor added the comment:

 For example, hCryptProv in Python/random.c is inheritable or not?

This is not a standard handle. GetHandleInformation() fails with a Windows 
error 6 (invalid descriptor).

I listed inheritable handles with a loop on range(0, 0x1001): only handles of 
stdin, stdout and stderr are inheritable. The other handles are not inheritable.

I also listed handles of parent and child processes using handle.exe tool 
from Microsoft. I see that the child has less open handle, all file handles 
that I opened manually are not inheried, and everything looks fine.

So I think that the issue can now be closed.

--
resolution:  - fixed
status: open - closed

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



[issue21384] Windows: Make handle non inheritable by default

2014-04-30 Thread STINNER Victor

STINNER Victor added the comment:

On Windows, handles are created non-inheritable by default, but I would prefer 
to double check.

The tool Handle can be used to list all open handles of a process:
http://technet.microsoft.com/en-us/sysinternals/bb896655.aspx

To test that all handles are non-inheritable: run all Python unit tests, create 
a subprocesss with close_fds=False, list open handles of the child process and 
check that the list of not longer than a fresh Python process.

--

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



[issue21384] Windows: Make handle non inheritable by default

2014-04-29 Thread STINNER Victor

New submission from STINNER Victor:

The PEP 446 was implemented in Python 3.4. All file descriptors are now created 
non inheritable. The implementation was not finished on Windows, handles may be 
created inheritable. The Python code should be audoted for that.

For example, hCryptProv in Python/random.c is inheritable or not?

--
components: Windows
messages: 217501
nosy: haypo, sbt, tim.golden
priority: normal
severity: normal
status: open
title: Windows: Make handle non inheritable by default
versions: Python 3.5

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