[Twisted-Python] Twisted 11.0 and Foolscap incompatibility
![](https://secure.gravatar.com/avatar/b7c170228f70f44f97604a2326b906f0.jpg?s=120&d=mm&r=g)
It looks like the new ssl/tls code doesn't work with Foolscap. The ConnectionMixin is treating the self.protocol object as a transport and calls write() and loseConnection() on it. Here is a traceback: Traceback (most recent call last): File "/usr/lib64/python2.6/site-packages/foolscap-0.6.1_-py2.6.egg/foolscap/slicers/root.py", line 107, in send d.callback(None) File "/usr/lib64/python2.6/site-packages/Twisted-11.0.0_r31548-py2.6-linux-x86_64.egg/twisted/internet/defer.py", line 361, in callback self._startRunCallbacks(result) File "/usr/lib64/python2.6/site-packages/Twisted-11.0.0_r31548-py2.6-linux-x86_64.egg/twisted/internet/defer.py", line 455, in _startRunCallbacks self._runCallbacks() File "/usr/lib64/python2.6/site-packages/Twisted-11.0.0_r31548-py2.6-linux-x86_64.egg/twisted/internet/defer.py", line 542, in _runCallbacks current.result = callback(current.result, *args, **kw) --- <exception caught here> --- File "/usr/lib64/python2.6/site-packages/foolscap-0.6.1_-py2.6.egg/foolscap/banana.py", line 216, in produce self.pushSlicer(slicer, obj) File "/usr/lib64/python2.6/site-packages/foolscap-0.6.1_-py2.6.egg/foolscap/banana.py", line 352, in pushSlicer openID = self.sendOpen() File "/usr/lib64/python2.6/site-packages/foolscap-0.6.1_-py2.6.egg/foolscap/banana.py", line 481, in sendOpen int2b128(openID, self.transport.write) File "/usr/lib64/python2.6/site-packages/foolscap-0.6.1_-py2.6.egg/foolscap/banana.py", line 24, in int2b128 stream(chr(0)) File "/usr/lib64/python2.6/site-packages/Twisted-11.0.0_r31548-py2.6-linux-x86_64.egg/twisted/internet/_newtls.py", line 176, in write self.protocol.write(bytes) exceptions.AttributeError: 'Broker' object has no attribute 'write' Any workarounds or suggestions? Reverting to Twisted 10.2 works for now. --Bill Noon Northeast Regional Climate Center Cornell University
![](https://secure.gravatar.com/avatar/e1554622707bedd9202884900430b838.jpg?s=120&d=mm&r=g)
On Apr 5, 2011, at 3:03 PM, Bill Noon wrote:
File "/usr/lib64/python2.6/site-packages/Twisted-11.0.0_r31548-py2.6-linux-x86_64.egg/twisted/internet/_newtls.py", line 176, in write
Nobody panic :). r31548 of trunk is not Twisted 11.0.0. Twisted 11.0 diverged from trunk as of <http://twistedmatrix.com/trac/changeset/31390>. Perhaps more tellingly, there is no _newtls.py in Twisted 11.0: <http://twistedmatrix.com/trac/browser/tags/releases/twisted-11.0.0/twisted/i...>. (Plus, I triple-checked the tarballs just now to make sure that they were released from the right place, and they were.) That revision of trunk would include <http://twistedmatrix.com/trac/changeset/31537> though, which is some new SSL code _not_ included in the 11.0 release. So - yes, this is a bug, but NOT in the 11.0 release. Please file a bug, noting that it's a regression. Depending on what level of nastiness foolscap is getting up to in order to trigger this behavior, we may have to revert <http://tm.tl/4854>.
![](https://secure.gravatar.com/avatar/b7c170228f70f44f97604a2326b906f0.jpg?s=120&d=mm&r=g)
On Apr 5, 2011, at 3:23 PM, Glyph Lefkowitz wrote:
On Apr 5, 2011, at 3:03 PM, Bill Noon wrote:
File "/usr/lib64/python2.6/site-packages/Twisted-11.0.0_r31548-py2.6-linux-x86_64.egg/twisted/internet/_newtls.py", line 176, in write
Nobody panic :).
Sorry about misstating that this was in the 11.0 release.
r31548 of trunk is not Twisted 11.0.0. Twisted 11.0 diverged from trunk as of <http://twistedmatrix.com/trac/changeset/31390>.
Perhaps more tellingly, there is no _newtls.py in Twisted 11.0: <http://twistedmatrix.com/trac/browser/tags/releases/twisted-11.0.0/twisted/i...>. (Plus, I triple-checked the tarballs just now to make sure that they were released from the right place, and they were.)
That revision of trunk would include <http://twistedmatrix.com/trac/changeset/31537> though, which is some new SSL code _not_ included in the 11.0 release.
So - yes, this is a bug, but NOT in the 11.0 release.
Please file a bug, noting that it's a regression. Depending on what level of nastiness foolscap is getting up to in order to trigger this behavior, we may have to revert <http://tm.tl/4854>.
Ok. It is ticket 5028, http://twistedmatrix.com/trac/ticket/5028 --Bill
![](https://secure.gravatar.com/avatar/e1554622707bedd9202884900430b838.jpg?s=120&d=mm&r=g)
On Apr 5, 2011, at 4:04 PM, Bill Noon wrote:
Ok. It is ticket 5028, http://twistedmatrix.com/trac/ticket/5028
As exarkun already noted here: <http://twistedmatrix.com/trac/ticket/5028#comment:2>, this is caused by foolscap manipulating an attribute which probably shouldn't have been public in the first place, and *definitely* isn't mutable. This means that there are several other types of instrumentation which foolscap will break. This is a popular ticket this week - I just mentioned it in another thread: <http://twistedmatrix.com/trac/ticket/3204>. If foolscap needs to switch protocols mid-stream, it either needs to do what AMP does, or contribute a real fix for that ticket. (And then require a new version of Twisted :).)
![](https://secure.gravatar.com/avatar/e1554622707bedd9202884900430b838.jpg?s=120&d=mm&r=g)
On Apr 5, 2011, at 3:03 PM, Bill Noon wrote:
Reverting to Twisted 10.2 works for now.
You should just revert to the actual released version of 11.0. How did you install 11.0? Is easy_install screen-scraping the wrong link again, or something like that? By the way; correct version number or not, thanks for bringing this to our attention. It's good to get feedback from user testing on features like this _before_ they make it into a release ;-). -glyph
![](https://secure.gravatar.com/avatar/b7c170228f70f44f97604a2326b906f0.jpg?s=120&d=mm&r=g)
On Apr 5, 2011, at 4:02 PM, Glyph Lefkowitz wrote:
On Apr 5, 2011, at 3:03 PM, Bill Noon wrote:
Reverting to Twisted 10.2 works for now.
You should just revert to the actual released version of 11.0. How did you install 11.0? Is easy_install screen-scraping the wrong link again, or something like that?
No, my fault for running from svn_head.
By the way; correct version number or not, thanks for bringing this to our attention. It's good to get feedback from user testing on features like this _before_ they make it into a release ;-).
Just doing my part... --Bill
participants (2)
-
Bill Noon
-
Glyph Lefkowitz