[Twisted-Python] Twisted 1.0.4 - admin/runtests failures?

Brian Warner warner at lothar.com
Wed Apr 23 18:57:34 EDT 2003


> Woops.  This is a localization problem.  Maybe it should be an expected
> skip for certain values of LC_LANG?  Or maybe we should just not use ls.

Hmm, it means popen2 used french while reactor.spawnProcess used english.
That test clears the environment before running spawnProcess.. maybe we
should let it inherit the complete environment from its parent.

Could you try the attached patch and see if it fixes the problem?

> Multicast is known to be broken in a few situations.  Can you describe
> your network setup.  In particular, do you have a firewall configured, or is
> the machine performing NAT?

I've seen that test fail on machines that don't have any external network
interfaces configured (just the loopback interface). My guess is that it has
to do with the 'MULTICAST' flag, which isn't usually set on lo.

thanks,
 -Brian

-------------- next part --------------
Index: twisted/internet/default.py
===================================================================
RCS file: /cvs/Twisted/twisted/internet/default.py,v
retrieving revision 1.72
diff -u -r1.72 default.py
--- twisted/internet/default.py	21 Apr 2003 15:32:15 -0000	1.72
+++ twisted/internet/default.py	23 Apr 2003 22:55:48 -0000
@@ -149,8 +149,10 @@
 
     # IReactorProcess
 
-    def spawnProcess(self, processProtocol, executable, args=(), env={}, path=None,
-                     uid=None, gid=None, usePTY = 0):
+    def spawnProcess(self, processProtocol, executable, args=(), env=None,
+                     path=None, uid=None, gid=None, usePTY=0):
+        if env == None:
+            env = os.environ
         p = platform.getType()
         if p == 'posix':
             if usePTY:
Index: twisted/internet/interfaces.py
===================================================================
RCS file: /cvs/Twisted/twisted/internet/interfaces.py,v
retrieving revision 1.78
diff -u -r1.78 interfaces.py
--- twisted/internet/interfaces.py	21 Apr 2003 19:53:39 -0000	1.78
+++ twisted/internet/interfaces.py	23 Apr 2003 22:55:49 -0000
@@ -324,7 +324,7 @@
 
 class IReactorProcess(Interface):
 
-    def spawnProcess(self, processProtocol, executable, args=(), env={}, path=None, uid=None, gid=None, usePTY=0):
+    def spawnProcess(self, processProtocol, executable, args=(), env=None, path=None, uid=None, gid=None, usePTY=0):
         """Spawn a process, with a process protcol.
 
         @param processProtocol: a L{ProcessProtocol} instance
@@ -337,7 +337,7 @@
                      executable's name.
 
         @param env: the environment variables to pass to the processs; a
-                    dictionary of strings.
+                    dictionary of strings. If 'None', use os.environ.
 
         @param path: the path to run the subprocess in - defaults to the
                      current directory.
Index: twisted/test/test_process.py
===================================================================
RCS file: /cvs/Twisted/twisted/test/test_process.py,v
retrieving revision 1.38
diff -u -r1.38 test_process.py
--- twisted/test/test_process.py	14 Apr 2003 06:28:27 -0000	1.38
+++ twisted/test/test_process.py	23 Apr 2003 22:55:49 -0000
@@ -378,7 +378,7 @@
         if not os.path.exists('/bin/ls'): raise RuntimeError("/bin/ls not found")
 
         p = Accumulator()
-        reactor.spawnProcess(p, '/bin/ls', ["/bin/ls", "ZZXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"], {}, "/tmp",
+        reactor.spawnProcess(p, '/bin/ls', ["/bin/ls", "ZZXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"], None, "/tmp",
                              usePTY=self.usePTY)
 
         while not p.closed:
@@ -391,7 +391,7 @@
         else: raise RuntimeError("gzip not found in /bin or /usr/bin")
         s = "there's no place like home!\n" * 3
         p = Accumulator()
-        reactor.spawnProcess(p, cmd, [cmd, "-c"], {}, "/tmp",
+        reactor.spawnProcess(p, cmd, [cmd, "-c"], None, "/tmp",
                              usePTY=self.usePTY)
         p.transport.write(s)
         p.transport.closeStdin()


More information about the Twisted-Python mailing list