Message388098
For whatever the reason and Windows version, it's still the case that _get_handles() should work around any bad standard handles in the current process. In bpo-25492, I suggested checking os.get_handle_inheritable(). That's too permissive. It should require a valid file handle, checked via _winapi.GetFileType(). For example:
if stdin is None:
p2cread = _winapi.GetStdHandle(_winapi.STD_INPUT_HANDLE)
if p2cread is not None:
try:
_winapi.GetFileType(p2cread)
except OSError:
p2cread = None |
|
Date |
User |
Action |
Args |
2021-03-04 15:59:11 | eryksun | set | recipients:
+ eryksun, terry.reedy, paul.moore, amaury.forgeotdarc, tim.golden, kevinwatters, tlesher, benjamin.peterson, trentm, twhitema, Weird, denversc, chn, zach.ware, steve.dower, borisompol |
2021-03-04 15:59:11 | eryksun | set | messageid: <1614873551.58.0.0684654253438.issue3905@roundup.psfhosted.org> |
2021-03-04 15:59:11 | eryksun | link | issue3905 messages |
2021-03-04 15:59:11 | eryksun | create | |
|