Ticket #1949: run-user-installed.diff

File run-user-installed.diff, 4.7 KB (added by Glyph, 16 years ago)
  • twisted/conch/test/test_recvline.py

     
    515515        # handle bytes we send to the child process.
    516516        exe = sys.executable
    517517        module = stdio.__file__
    518         args = ["python2.3", module, reflect.qual(self.serverProtocol)]
    519         env = {"PYTHONPATH": os.pathsep.join(sys.path)}
     518        args = [exe, module, reflect.qual(self.serverProtocol)]
     519        env = os.environ.copy()
     520        env.update({"PYTHONPATH": os.pathsep.join(sys.path)})
    520521
    521522        from twisted.internet import reactor
    522523        clientTransport = reactor.spawnProcess(processClient, exe, args,
  • twisted/test/test_process.py

     
    184184        scriptPath = util.sibpath(__file__, "process_twisted.py")
    185185        p = Accumulator()
    186186        d = p.endedDeferred = defer.Deferred()
    187         env = {"PYTHONPATH": os.pathsep.join(sys.path)}
     187        env = os.environ.copy()
     188        env.update({"PYTHONPATH": os.pathsep.join(sys.path)})
    188189        reactor.spawnProcess(p, exe, [exe, "-u", scriptPath], env=env,
    189190                             path=None, usePTY=self.usePTY)
    190191        p.transport.write("hello, world")
  • twisted/test/test_unix.py

     
    66import stat, os, sys
    77
    88from twisted.internet import interfaces, reactor, protocol, error, address, defer, utils
    9 from twisted.python import lockfile, failure
    10 from twisted.protocols import loopback
     9from twisted.python import lockfile
    1110from twisted.trial import unittest
    1211
    1312
     
    145144        self.filename = self.mktemp()
    146145        source = ("from twisted.internet import protocol, reactor\n"
    147146                  "reactor.listenUNIX(%r, protocol.ServerFactory(), wantPID=True)\n") % (self.filename,)
    148         env = {'PYTHONPATH': os.pathsep.join(sys.path)}
     147        env = os.environ.copy()
     148        env.update({'PYTHONPATH': os.pathsep.join(sys.path)})
    149149
    150150        d = utils.getProcessOutput(sys.executable, ("-u", "-c", source), env=env)
    151151        d.addCallback(callback)
  • twisted/test/test_iutils.py

     
    3333        scriptFile = self.makeSourceFile([
    3434            'print "hello world"'
    3535            ])
    36         d = utils.getProcessOutput(sys.executable, ['-u', scriptFile])
     36        d = utils.getProcessOutput(sys.executable, ['-u', scriptFile], env=os.environ)
    3737        return d.addCallback(self.assertEquals, "hello world\n")
    3838
    3939    def testOutputWithErrorIgnored(self):
     
    4444            'sys.stderr.write("hello world\\n")'
    4545            ])
    4646
    47         d = utils.getProcessOutput(exe, ['-u', scriptFile], errortoo=0)
     47        d = utils.getProcessOutput(exe, ['-u', scriptFile], errortoo=0, env=os.environ)
    4848        return self.assertFailure(d, IOError)
    4949
    5050    def testOutputWithErrorCollected(self):
     
    5555            'sys.stderr.write("hello world\\n")'
    5656            ])
    5757
    58         d = utils.getProcessOutput(exe, ['-u', scriptFile], errortoo=1)
     58        d = utils.getProcessOutput(exe, ['-u', scriptFile], errortoo=1, env=os.environ)
    5959        return d.addCallback(self.assertEquals, "hello world" + os.linesep)
    6060
    6161    def testValue(self):
     
    6565            "sys.exit(1)"
    6666            ])
    6767
    68         d = utils.getProcessValue(exe, ['-u', scriptFile])
     68        d = utils.getProcessValue(exe, ['-u', scriptFile], env=os.environ)
    6969        return d.addCallback(self.assertEquals, 1)
    7070
    7171    def testOutputAndValue(self):
     
    8181            self.assertEquals(out, "hello world!" + os.linesep)
    8282            self.assertEquals(err, "goodbye world!" + os.linesep)
    8383            self.assertEquals(code, 1)
    84         d = utils.getProcessOutputAndValue(exe, [scriptFile])
     84        d = utils.getProcessOutputAndValue(exe, [scriptFile], env=os.environ)
    8585        return d.addCallback(gotOutputAndValue)
    8686
    8787    def testOutputSignal(self):
     
    104104            self.assertEquals(err, "stderr bytes" + os.linesep)
    105105            self.assertEquals(sig, signal.SIGKILL)
    106106
    107         d = utils.getProcessOutputAndValue(exe, ['-u', scriptFile])
     107        d = utils.getProcessOutputAndValue(exe, ['-u', scriptFile], env=os.environ)
    108108        return d.addErrback(gotOutputAndValue)
    109109
    110110