Ticket #1061: handleinherit.2.patch

File handleinherit.2.patch, 745 bytes (added by parshin, 9 years ago)
  • slave/buildslave/commands/transfer.py

    diff --git a/slave/buildslave/commands/transfer.py b/slave/buildslave/commands/transfer.py
    index 39b9086..a22ef4a 100644
    a b  
    11import os, tarfile, tempfile
    22
     3import win32api, win32con
     4import msvcrt
     5
    36from twisted.python import log
    47from twisted.internet import defer
    58
    class SlaveFileDownloadCommand(Command): 
    251254
    252255        try:
    253256            self.fp = open(self.path, 'wb')
     257
     258            win32api.SetHandleInformation(msvcrt.get_osfhandle(self.fp.fileno()), win32con.HANDLE_FLAG_INHERIT, 0)
     259
    254260            if self.debug:
    255261                log.msg("Opened '%s' for download" % self.path)
    256262            if self.mode is not None: