This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients Weird, amaury.forgeotdarc, benjamin.peterson, borisompol, chn, denversc, eryksun, kevinwatters, paul.moore, steve.dower, terry.reedy, tim.golden, tlesher, trentm, twhitema, zach.ware
Date 2021-03-04.15:59:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1614873551.58.0.0684654253438.issue3905@roundup.psfhosted.org>
In-reply-to
Content
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
History
Date User Action Args
2021-03-04 15:59:11eryksunsetrecipients: + 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:11eryksunsetmessageid: <1614873551.58.0.0684654253438.issue3905@roundup.psfhosted.org>
2021-03-04 15:59:11eryksunlinkissue3905 messages
2021-03-04 15:59:11eryksuncreate