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
If you've ever had your password eaten by our Trac instance, had your comment rejected by spambayes, or seen the amount of effort it takes removing random nulls from our htpasswd files, rejoice! With https://github.com/twisted-infra/braid/pull/192 , we are moving our Trac instance to log in using GitHub OAuth. This should mean we solve the issue of keeping passwords (making you and us more secure), being able to turn off the spam filter (as we don't have anonymous ticket submittal, and github is better at catching spammers than we are), and hopefully cause less ongoing issues with passwords suddenly not working.
What this means for you is that your username and password will no longer work for logging into our Trac, you will need to authorise your GitHub login to access it. This means that you may have another username, please contact me privately and I will see what I can do about migrating any ticket histories over, if you feel like it is needed.
I'm trying to lock down a box, and came across a peculiarity with a twisted dameon -- it's binding to 0.0.0.0 for UDP on an arbitrary port
I can'f figure out why this is happening -- I'm not consciously/explicitly using anything on UDP, and the port changes every time I start up a daemon.
Does anyone have a clue what it could be?
In my UDP Twisted based library there is a problem with IPv6 addresses
representation. Addresses are compared as simple strings, and it
sometimes causes mismatches:
"fe80::aaaa:bbff:fecc:dddd" should be equal to
I've noticed that Python 3 has nice new module "ipaddress" exactly for
this kind of problems, and it has been backported to Python 2.7.
Before I add it as a new dependency I wanted to ask if maybe Twisted
has some other suggested solution for this problem?
I've been using a pattern for quite some time to collect a bunch o'
deferreds in a list and then yield on them one at a time. Here is some
def foo( ls ):
defs = 
# get all the deferreds going
for item in ls:
d = some_deferred_returning_function( item )
defs.append( ( item, d ) ) # associate item with deferred
# process results not as they come in but in the original order
for ( item, d ) in defs:
result = yield d
print 'The result on item', item, 'is', result
In this way, I can get good concurrency (by spinning up all deferreds at
once) but also I can iterate on the results using a straightforward
traversal of the list data structure and yield. This is working great for
me. But on occasion I'd prefer that I can access the results not in the
order that I originally got, but rather in the order of completion of the
deferreds, so the faster ones come in first, and the slower ones don't hold
up faster ones. The usual case when I'd want this is when I have "slower"
deferreds near the front, and "faster" deferreds near the back. I can't
help but think that there's some async data structure out there for me that
can solve this. I've used DeferredList before, and I can't see that it
does what I want: it gives you a choice between getting all results only
when they are all done (default behavior), or getting the first one that's
ready (fireOnOneCallback=True). I want all results, but I want the
processing of the results to unfold as the results come in.
Thanks for any ideas.
I have a latency sensitive application that gets affected when it is
moved between cores or the system has to wake from idling. I would like
to run the thread in as tight a loop as possible and to do this i need
to cause epollreactor to busyspin on receiving data. I have worked out
how to do it by editing the twisted code directly by hard coding the
value of `timeout` to be 0 at this location in the code
Is it possible to actually set this on the reactor in a more sensible
way so I don't need to patch the twisted codebase. ? Below is basically
what I am doing.
def doPoll(self, timeout):
Poll the poller for new events.
+ timeout = 0
- if timeout is None:
- timeout = -1 # Wait indefinitely.
Do you wish you could:
* Use the power of Twisted's asynchronous networking in Django, Flask,
or other threaded applications?
* Provide a blocking API powered by Twisted underneath, without
exposing it to the caller?
* Write a library that provides APIs both for Twisted and non-Twisted
* Use threads more easily inside Twisted applications?
Crochet lets you do all that, and more, by hiding and automatically
starting the Twisted reactor and providing a blocking API for calling
into Twisted. If you need to use your library from a normal Twisted
application you can disable the auto-start functionality. Here's an
example of using Twisted in a blocking manner:
from __future__ import print_function
from twisted.names import client
from crochet import setup, wait_for
"""Use the Twisted DNS library."""
d = client.lookupAddress(name)
d.addCallback(lambda result: result.payload.dottedQuad())
if __name__ == '__main__':
# Application code using the public API - notice it works in a normal
# blocking manner, with no event loop visible:
name = sys.argv
ip = gethostbyname(name)
print(name, "->", ip)
New in 1.5.0 is official Python 3.5 support; Python 2.6, 3.3 and older
versions of Twisted are no longer officially supported (but are likely
to still work).
If you need help using Crochet (or just general Twisted or Python help)
I am currently available for short-term consulting. You can read the
documentation at https://crochet.readthedocs.org/.
On behalf of Twisted Matrix Laboratories, I am honoured to announce the release of Twisted 16.1!
This release is hot off the heels of 16.0 released last month, including some nice little tidbits. The highlights include:
- twisted.application.internet.ClientService, a service that maintains a persistent outgoing endpoint-based connection -- a replacement for ReconnectingClientFactory that uses modern APIs;
- A large (77% on one benchmark) performance improvement when using twisted.web's client on PyPy;
- A few conch modules have been ported to Python 3, in preparation for further porting of the SSH functionality;
- Full support for OpenSSL 1.0.2f and above;
- t.web.http.Request.addCookie now accepts Unicode and bytes keys/values;
- `twistd manhole` no longer uses a hard-coded SSH host key, and will generate one for you on the fly (this adds a 'appdirs' PyPI dependency, installing with [conch] will add it automatically);
- Over eighteen tickets overall closed since 16.0.
For more information, check the NEWS file (link provided below).
You can find the downloads at <https://pypi.python.org/pypi/Twisted> (or alternatively <http://twistedmatrix.com/trac/wiki/Downloads>). The NEWS file is also available at <https://github.com/twisted/twisted/blob/twisted-16.1.0/NEWS>.
Many thanks to everyone who had a part in this release - the supporters of the Twisted Software Foundation, the developers who contributed code as well as documentation, and all the people building great things with Twisted!
Amber Brown (HawkOwl)