hi there, folks:
I'd really like to release 0.7.0 but I would like it to be at least a
little bit tested before I do so. Could those of you with CVS trees check
everything out and see if it performs as advertised? Deeper bugs than
that will have to wait for the next release, but I'd at least like to know
if it works for someone other than me.
______ __ __ _____ _ _
| ____ | \_/ |_____] |_____|
|_____| |_____ | | | |
@ t w i s t e d m a t r i x . c o m
On 18 May 2004, the following message was posted to this mailinglist:
Jp Calderone exarkun at divmod.com wrote:
>Daniel Newton wrote:
> I have a simple XML-PRC server similar to the example below:
> from twisted.web import xmlrpc, server
> class Example(xmlrpc.XMLRPC):
> """An example object to be published."""
> def xmlrpc_add(self, a, b):
> """Return sum of arguments."""
> return a + b
> if __name__ == '__main__':
> from twisted.internet import reactor
> r = Example()
> reactor.listenTCP(7080, server.Site(r))
> I want to be able to get the address of the client that calls the
> method can anyone help me with this?
This solution didn't work because 'transport' isn't a property of the
I'm currently in the process of changing from a customized
SimpleXMLRPCServer to a twisted XMLRPC server solution and I need to
insert the client IP into the attributes passed to the called xmlrpc
method. Anyone who knows the answer and is willing to share the info?
Wait, wait, that causes *hangs*? That seems like a bad thing. It
doesn't look like an obviously wrong thing to do to me. Do you know
*why* it's hanging?
On Jul 23, 2004, at 2:06 AM, Andrew Bennetts wrote:
> warner and I agree that this test wasn't testing any useful behaviours
> anything could actually depend upon, and it causes far too many
> test failures (and even hangs!)
> -class PausingProcessProtocol(protocol.ProcessProtocol):
> - data = ""
> - elapsed = None
> - def connectionMade(self):
> - self.transport.pauseProducing()
> - self.transport.write("a")
> - reactor.callLater(2, self.transport.resumeProducing)
> - def outReceived(self, d):
> - self.data += d
> - def processEnded(self, reason):
> - self.data = self.data.lstrip("a")
> - if len(self.data) != 5:
> - self.elapsed = ValueError # XXX!
> - else:
> - self.elapsed = float(self.data)
> - def testPausing(self):
> - exe = sys.executable
> - scriptPath = util.sibpath(__file__, "process_pausing.py")
> - p = PausingProcessProtocol()
> - reactor.spawnProcess(p, exe, [exe, "-u", scriptPath],
> - while p.elapsed == None:
> - reactor.iterate(0.01)
> - self.failIfEqual(p.elapsed, ValueError, 'Child process wrote
> - self.assert_(2.1 > p.elapsed > 1.5) # assert how long process
> was paused
I'm working on porting the mod_pubsub system to use the twisted
framework. So far things are great, but I have one point of
clarificaction. With all the standard reactors, how are writes handled
in a non-blocking manner? Copying from some of the sample protocols, I
have a dataReceived method in my Protocol implementation that looks
vaguely like this:
def dataReceived(self, data):
self.inbuf += data
if self.canReply() == true:
My question is: does write() make a non-blocking write, and if so does
it reschedule itself later on automatically? Does it block? What is
the preferred way of handling this?
When a Twisted web server is killed, I'd like to somehow get a signal from
the server that its going down and clean up some objects (I.e., a PB Client
instance -- need to log it out of the PB Server on shutdown) that I've
persisted in the web server's registry. Has anyone done this before? Any
suggestions besides perhaps usng the shutdown script to instantiate an HTTP
client which fires a URL to the server which acts as a trigger to handle the
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
I'm getting a problem with "Failed to load application: No module named
I have a test.tac and a system.py inside a user (joe) home directory. I
can start it as Joe:
[joe@bubbles joe]$ twistd -y test.tac
However, when I try to start it as root in joe's home dir, I get the
"Failed to load application" error message.
[root@bubbles joe]# twist -y test.tac
Failed to load application: No module named system
I solved it via adding Joe's home dir (/home/joe) to the pythonpath in
root's acct. Why can't it import the system module even though it's in
the same dir? A python prompt does work when I manually import the module.
Beware that you will soon need to update your PATH declarations to
include Twisted/bin/conch/ in addition to Twisted/bin/. Same for lore,
mail, and perhaps others.
Twisted | Christopher Armstrong: International Man of Twistery
Radix | Release Manager, Twisted Project
So, I propose to make the following change. I see no reason to destroy
any hope of proper debugging support by doing a callLater of set_trace,
for one. For two: control-c *really* ought to break into the debugger.
Is there an actual reason why the previous code did
--- twisted/application/app.py (revision 11112)
+++ twisted/application/app.py (working copy)
@@ -84,7 +84,8 @@
sys.stdout = oldstdout
sys.stderr = oldstderr
if runtime.platformType == 'posix':
- signal.signal(signal.SIGUSR2, lambda *args:
+ signal.signal(signal.SIGUSR2, lambda *args:
+ signal.signal(signal.SIGINT, lambda *args:
--- twisted/internet/default.py (revision 11112)
+++ twisted/internet/default.py (working copy)
@@ -90,7 +90,9 @@
"""Install the signal handlers for the Twisted event loop."""
- signal.signal(signal.SIGINT, self.sigInt)
+ if signal.getsignal(signal.SIGINT) ==
+ # only handle if there isn't already a handler, e.g. for
+ signal.signal(signal.SIGINT, self.sigInt)
# Catch Ctrl-Break in windows (only available in Python 2.2