[Twisted-Python] twisted/python3/ubuntu 12.10

it seems that Ubuntu 12.10 will only preinstall Python3, no Python2.7. So programs using twisted (including my own) will not come preinstalled. how is progress going with twisted and Python3? -- Wolfgang

Hi, On Thu, Jun 14, 2012 at 2:27 PM, Wolfgang Rohdewald <wolfgang@rohdewald.de> wrote:
I'm working on Python 3 support as a GSoC project for this summer. It's too early to give an estimate, but getting it all done by Ubuntu 12.10 is a very optimistic goal. You'll be able to follow progress on my blog [1], though it's currently... out-dated. As far as Ubuntu itself is concerned, I wasn't aware that Twisted is available from the default Ubuntu CD. Per [2], this is the only thing that will be affected - what is shipped on the CD. All the other Python 2 packages will be available normally through the repos. [1] vperic.blogspot.com [2] https://wiki.ubuntu.com/Python/FoundationsQPythonVersions
-- Vladimir Perić

Am Donnerstag, 14. Juni 2012, 14:46:45 schrieb Vladimir Perić:
As far as Ubuntu itself is concerned, I wasn't aware that Twisted is available from the default Ubuntu CD.
you are right, it is not. I thought all of kdegames is preinstalled but actually only kpat is there. Sorry for the noise. -- Wolfgang

On 14 June 2012 13:46, Vladimir Perić <vlada.peric@gmail.com> wrote: ...
As far as Ubuntu itself is concerned, I wasn't aware that Twisted is available from the default Ubuntu CD.
It's on the Ubuntu 12.04 Server CD; see http://cdimages.ubuntu.com/ubuntu-server/precise/daily/current/precise-serve...

Hi again, I've a bit of code that does the following: f = MyReconnectingClientFactory() iConn = reactor.connectSSL(url, port, f, ssl.ClientContextFactory()) now I would expect that iConn.factory would be my f, but as it turns out it's an instance of some TLSMemoryBIOFactory.. Why is that so? After some digging, I was able to find f under iConn.transport.protocol.wrappedProtocol.factory.. I'm happy to use that, but it just sounds a bit weird to me.. or is this normal? Cheers

On 14 Jun, 03:34 pm, martin@webscio.net wrote:
There is no "factory" attribute on the `IConnector` interface at all: http://twistedmatrix.com/documents/current/api/twisted.internet.interfaces.I... Neither is there a "transport" attribute, nor do any of the transport interfaces have a "protocol" attribute. All this means that Twisted isn't promising you anything about the meaning or existence of any of these attributes. So, why don't you just use `f` instead? Jean-Paul

On 15/06/12 01:40, exarkun@twistedmatrix.com wrote:
I can't use f because I'm saving the IConnector object for later, so that I can disconnect it when needed. I'm not sure if saving the f object would have any effect, since doing anything to that after the connection was created will surely have no effect, or? In general, I can do iConn.disconnect(), but this being a ReconnectingClientFactory, it attempts to reconnect straight away.. That's why I was looking to get the factory object somehow, so that I could call stopTrying() on it first. If there's a better approach to this, please let me know :) Thanks

On 08:50 am, martin@webscio.net wrote:
This doesn't make sense. `f` is not an object and neither is `connector.factory` nor `connector.transport.protocol.wrappedProtocol.factory`. They're expressions that, at least in this case, and in the context you're using them, all evaluate to the same object: the MyReconnectingClientFactory instance created at the beginning of your example code. It doesn't matter which of them you call stopTrying on, since there isn't actually any "them", there's just the single factory object. Put another way, saving `f` will let you do exactly what you want, in part because it's no different from what the `IConnector` implementation happens to be doing. Jean-Paul

On 15/06/12 14:15, exarkun@twistedmatrix.com wrote:
Hm OK. As I said I'm completely new to this. I just figured that since the f instance was created before the connection was made, it would not be really related to the connection. What happens if I create two SSL connections with the same factory f? Would calling "stopTrying" on that f then affect both connections? Or just the last? I guess I can simply test this out myself, it's just slightly weird to me. :)

On Thu, Jun 14, 2012 at 8:17 AM, Gavin Panella <gavin@gromper.net> wrote:
It's on the Ubuntu 12.04 Server CD; see http://cdimages.ubuntu.com/ubuntu-server/precise/daily/current/precise-serve...
Canonical's Landscape tool uses Twisted AMQP. -- David Strauss | david@davidstrauss.net

On Jun 14, 2012, at 02:27 PM, Wolfgang Rohdewald wrote:
Just to be clear, the mandate for Python 3 is just for the standard desktop image. We won't ship Python 2 on that image, but this does not affect server or any other flavor. It doesn't change what /usr/bin/python points to or the status of Python 2 in the archives. It *does* mean that right after a fresh install from the desktop image, you won't have /usr/bin/python, but you will have /usr/bin/python3, and you'll likely get Python 2 pretty soon after you install anything not on the image. We're having some internal discussions about how Canonical and Ubuntu can help with the porting effort, but as is usual these things take time. I've been hoping to get in touch with Vladimir on IRC to discuss things further, but just haven't connected yet. Cheers, -Barry

Apologies for continuing a bit OT, but I suspect others on twisted-python would be interested too ... So when you "get Python 2" would that be /usr/bin/python2? And if you wanted a /usr/bin/python, it would be up to you to create a link to whichever of 2 or 3 you wanted it to be? Steve On 06/15/2012 10:23 AM, Barry Warsaw wrote:

Le 15/06/2012 17:41, Stephen Waterbury a écrit :
No, /usr/bin/python will stay Python 2, and Python 3 will continue to reside at /usr/bin/python3. At least for the foreseeable future and if you don't create the links yourself. -- Thomas

Hi, On Thu, Jun 14, 2012 at 2:27 PM, Wolfgang Rohdewald <wolfgang@rohdewald.de> wrote:
I'm working on Python 3 support as a GSoC project for this summer. It's too early to give an estimate, but getting it all done by Ubuntu 12.10 is a very optimistic goal. You'll be able to follow progress on my blog [1], though it's currently... out-dated. As far as Ubuntu itself is concerned, I wasn't aware that Twisted is available from the default Ubuntu CD. Per [2], this is the only thing that will be affected - what is shipped on the CD. All the other Python 2 packages will be available normally through the repos. [1] vperic.blogspot.com [2] https://wiki.ubuntu.com/Python/FoundationsQPythonVersions
-- Vladimir Perić

Am Donnerstag, 14. Juni 2012, 14:46:45 schrieb Vladimir Perić:
As far as Ubuntu itself is concerned, I wasn't aware that Twisted is available from the default Ubuntu CD.
you are right, it is not. I thought all of kdegames is preinstalled but actually only kpat is there. Sorry for the noise. -- Wolfgang

On 14 June 2012 13:46, Vladimir Perić <vlada.peric@gmail.com> wrote: ...
As far as Ubuntu itself is concerned, I wasn't aware that Twisted is available from the default Ubuntu CD.
It's on the Ubuntu 12.04 Server CD; see http://cdimages.ubuntu.com/ubuntu-server/precise/daily/current/precise-serve...

Hi again, I've a bit of code that does the following: f = MyReconnectingClientFactory() iConn = reactor.connectSSL(url, port, f, ssl.ClientContextFactory()) now I would expect that iConn.factory would be my f, but as it turns out it's an instance of some TLSMemoryBIOFactory.. Why is that so? After some digging, I was able to find f under iConn.transport.protocol.wrappedProtocol.factory.. I'm happy to use that, but it just sounds a bit weird to me.. or is this normal? Cheers

On 14 Jun, 03:34 pm, martin@webscio.net wrote:
There is no "factory" attribute on the `IConnector` interface at all: http://twistedmatrix.com/documents/current/api/twisted.internet.interfaces.I... Neither is there a "transport" attribute, nor do any of the transport interfaces have a "protocol" attribute. All this means that Twisted isn't promising you anything about the meaning or existence of any of these attributes. So, why don't you just use `f` instead? Jean-Paul

On 15/06/12 01:40, exarkun@twistedmatrix.com wrote:
I can't use f because I'm saving the IConnector object for later, so that I can disconnect it when needed. I'm not sure if saving the f object would have any effect, since doing anything to that after the connection was created will surely have no effect, or? In general, I can do iConn.disconnect(), but this being a ReconnectingClientFactory, it attempts to reconnect straight away.. That's why I was looking to get the factory object somehow, so that I could call stopTrying() on it first. If there's a better approach to this, please let me know :) Thanks

On 08:50 am, martin@webscio.net wrote:
This doesn't make sense. `f` is not an object and neither is `connector.factory` nor `connector.transport.protocol.wrappedProtocol.factory`. They're expressions that, at least in this case, and in the context you're using them, all evaluate to the same object: the MyReconnectingClientFactory instance created at the beginning of your example code. It doesn't matter which of them you call stopTrying on, since there isn't actually any "them", there's just the single factory object. Put another way, saving `f` will let you do exactly what you want, in part because it's no different from what the `IConnector` implementation happens to be doing. Jean-Paul

On 15/06/12 14:15, exarkun@twistedmatrix.com wrote:
Hm OK. As I said I'm completely new to this. I just figured that since the f instance was created before the connection was made, it would not be really related to the connection. What happens if I create two SSL connections with the same factory f? Would calling "stopTrying" on that f then affect both connections? Or just the last? I guess I can simply test this out myself, it's just slightly weird to me. :)

On Thu, Jun 14, 2012 at 8:17 AM, Gavin Panella <gavin@gromper.net> wrote:
It's on the Ubuntu 12.04 Server CD; see http://cdimages.ubuntu.com/ubuntu-server/precise/daily/current/precise-serve...
Canonical's Landscape tool uses Twisted AMQP. -- David Strauss | david@davidstrauss.net

On Jun 14, 2012, at 02:27 PM, Wolfgang Rohdewald wrote:
Just to be clear, the mandate for Python 3 is just for the standard desktop image. We won't ship Python 2 on that image, but this does not affect server or any other flavor. It doesn't change what /usr/bin/python points to or the status of Python 2 in the archives. It *does* mean that right after a fresh install from the desktop image, you won't have /usr/bin/python, but you will have /usr/bin/python3, and you'll likely get Python 2 pretty soon after you install anything not on the image. We're having some internal discussions about how Canonical and Ubuntu can help with the porting effort, but as is usual these things take time. I've been hoping to get in touch with Vladimir on IRC to discuss things further, but just haven't connected yet. Cheers, -Barry

Apologies for continuing a bit OT, but I suspect others on twisted-python would be interested too ... So when you "get Python 2" would that be /usr/bin/python2? And if you wanted a /usr/bin/python, it would be up to you to create a link to whichever of 2 or 3 you wanted it to be? Steve On 06/15/2012 10:23 AM, Barry Warsaw wrote:

Le 15/06/2012 17:41, Stephen Waterbury a écrit :
No, /usr/bin/python will stay Python 2, and Python 3 will continue to reside at /usr/bin/python3. At least for the foreseeable future and if you don't create the links yourself. -- Thomas
participants (10)
-
Barry Warsaw
-
David Strauss
-
exarkun@twistedmatrix.com
-
Gavin Panella
-
Itamar Turner-Trauring
-
Martin
-
Stephen Waterbury
-
Thomas Hervé
-
Vladimir Perić
-
Wolfgang Rohdewald