Author Bernt.Røskar.Brenna
Recipients Bernt.Røskar.Brenna, astrand, gps, neologix, r.david.murray, sbt, tim.golden, vstinner
Date 2013-11-18.12:42:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1384778552.37.0.0082262544333.issue19575@psf.upfronthosting.co.za>
In-reply-to
Content
And here's a function that does not require pywin32:

def open_noinherit_ctypes(*args, **kwargs):
    HANDLE_FLAG_INHERIT = 1

    import msvcrt
    from ctypes import windll, WinError
    fp = open(*args, **kwargs)
    if not windll.kernel32.SetHandleInformation(msvcrt.get_osfhandle(fp.fileno()), HANDLE_FLAG_INHERIT, 0):
        raise WinError()
    return fp
History
Date User Action Args
2013-11-18 12:42:32Bernt.Røskar.Brennasetrecipients: + Bernt.Røskar.Brenna, astrand, vstinner, gps, tim.golden, r.david.murray, neologix, sbt
2013-11-18 12:42:32Bernt.Røskar.Brennasetmessageid: <1384778552.37.0.0082262544333.issue19575@psf.upfronthosting.co.za>
2013-11-18 12:42:32Bernt.Røskar.Brennalinkissue19575 messages
2013-11-18 12:42:32Bernt.Røskar.Brennacreate