Re: [Twisted-Python] are there known ssl/threading/socket issues with httplib2/httplib and Twisted ?

2014-09-17 Thread Andrew Bennetts
Jonathan Vanasco wrote: > > Background: > I'm using a 3rd party API client, which uses httplib2 in the internals. > ( the google-plus api ) > I'm placing this blocking code within a DeferredList, that runs within a > twisted.enterprise.adbapi.ConnectionPool.runInteraction >

Re: [Twisted-Python] Lore and generating reStructuredText (Lore2Sphinx)

2013-03-26 Thread Andrew Bennetts
Kevin Horn wrote: […] > Why? What does this buy us? To me it seems more complicated, requires […] > > If it's just an incremental transition, then I think we can get that > without resorting to relying on the guts of two fairly complicated systems. Although I'm blissfully ignorant of the deeper

Re: [Twisted-Python] Using StandardIO and pipes.

2012-08-09 Thread Andrew Bennetts
Maxim Lacrima wrote: […] > So my conclusions are: > 1. When I write to stdin of my script from keyboard then > `self.transport.write()` works as expected. > 2. When I use pipes or redirection to my script `self.transport.write()` > doesn't produce any output. > 3. If I replace self.transport.write(

Re: [Twisted-Python] deferred graph?

2012-07-18 Thread Andrew Bennetts
Dan Stromberg wrote: > On Wed, Jul 18, 2012 at 3:32 AM, wrote: > > > > I don't think anything in the thread suggested that this approach will > > circumvent a time.sleep(10) call. > > I'm not sure where you're getting this circumvention issue from. At this point I'm not sure what the problem you

Re: [Twisted-Python] deferred graph?

2012-07-16 Thread Andrew Bennetts
Dan Stromberg wrote: […] > I'm playing with twisted.internet.defer.setDebugging now. > > Is there a corresponding function that can be used to produce its report? > If I use it in a program with an infinite loop, it seems like I never get > the report, but if I use it in a program with a finite le

Re: [Twisted-Python] deferred graph?

2012-07-16 Thread Andrew Bennetts
Dan Stromberg wrote: […] > Can anyone think of other ways of getting to the bottom of this? Perhaps > some field in a deferred or deferredList I can introspect to get better > specifics? > > Is monkey patching an identifier of some sort into each deferred > reasonable? The intent would be to mak

Re: [Twisted-Python] call XMLRPC

2012-04-17 Thread Andrew Bennetts
joel tremblet wrote: […] > But the code doesn't work, I have the same error message about xml_rpc > answer > > [Failure instance: Traceback: : 'server error. invalid method parameters'> That's an error from the server. Without knowing how that server works there's not much we can do to help yo

Re: [Twisted-Python] defer.inlineCallbacks dosn't work with cython, deferredGenerator does.

2012-04-09 Thread Andrew Bennetts
On Tue, Apr 10, 2012 at 12:41:17PM +0800, gelin yan wrote: […] > When trying to run inlineCallbacks with Cython, a TypeError would come > out like: > > TypeError: inlineCallbacks requires to produce a > generator; instead got > test is the function where inlineCallbacks uses. > > It looks

Re: [Twisted-Python] MemoryError in twisted.internet.abstract.FileDescriptor

2011-12-14 Thread Andrew Bennetts
Augusto Mecking Caringi wrote: > >>> om[3082188716].c […] > str(2917687304 > 53120905B 1par 'ype: Test\nDate: 2011-12-14 > 16:45:30.995217\nEvent-Subtype: FooBar\nContent-Type: > application/json\n\n{\n ') So it appears you have 53 megabyte string that's referenced from your TLS connection, presum

Re: [Twisted-Python] How to explicitly free memory in twisted daemon process

2011-09-26 Thread Andrew Bennetts
On Tue, Sep 27, 2011 at 07:48:20AM +0800, Don Li wrote: > Hi, > > I have facing a problem: > "According to the Python memory pool mechanism, the memory usage will take > up more and more in a long-running daemon process. > "In the long sustained logon and logout logic by a lot of users , Twist

Re: [Twisted-Python] Adding introspection to xlmrpc server

2011-07-31 Thread Andrew Bennetts
Justin Frost wrote: >I'm trying the example found at: >[1]http://twistedmatrix.com/documents/current/web/howto/xmlrpc.html#auto3 >And it doesn't seem to be working.  The following test code fails: >import xmlrpclib >s = xmlrpclib.ServerProxy("http://localhost:8080";) >print

Re: [Twisted-Python] Moving Twisted off Trac and SVN to somewhere nicer

2011-07-03 Thread Andrew Bennetts
Michael Thompson wrote: [...] > Small, documentation diffs, for instance can be reduced to a single > click for a core developer to merge the change to trunk. I doubt that single click writes a NEWS file, or tests that the diff as applied to current trunk builds cleanly on a buildslave. So this m

Re: [Twisted-Python] Twisted training slides

2011-06-18 Thread Andrew Bennetts
Jasper St. Pierre wrote: […] > * Slide 124: As I understand, DeferredList is a bit dated, and you > should use gatherResults instead -- it returns a deferred, and it > hands you a list of all the results in the callback. The dialogue is > also a bit repetitive (a list of Deferreds! I hand it a li

Re: [Twisted-Python] Looking for Devs to answer noob questions on 6/22 & 6/23

2011-06-15 Thread Andrew Bennetts
David Shein wrote: >Hey Twisted Developers, > >I'm looking to get a half dozen devs who will commit to being on the >Twisted IRC channel next Wed and Thurs during biz hours to answer noobish Business hours in which timezone? -Andrew. ___

Re: [Twisted-Python] integrating a python REPL into my existing twisted application

2011-05-29 Thread Andrew Bennetts
Benjamin Rutt wrote: […] >Thanks.� I'm having trouble integrating this or Andrew's idea into my >example.� The simplest case doesn't quite work right for me (I see '>>>' >prompts, and can interact with the python interpreter but the banner >appears at the end of the REPL after I pre

Re: [Twisted-Python] integrating a python REPL into my existing twisted application

2011-05-25 Thread Andrew Bennetts
Benjamin Rutt wrote: >Dear twisted-python, >� >I�m trying to integrate a python REPL into my existing twisted 8.2.0 >client-side program (which talks to another twisted server running a >custom protocol).� This client side program uses >twisted.internet.stdio.StandardIO alre

Re: [Twisted-Python] problems with transport.write

2011-04-28 Thread Andrew Bennetts
gary clark wrote: > Much appreciated on the quick response. > > It fails by writing a large string at the server side and not receiving any > data at the client. The client uses open-ssl and is blocking to receive data. > I dont know if its possible to determine if the write was successful or not

Re: [Twisted-Python] some confusion with daemonising my twisted application.

2011-04-26 Thread Andrew Bennetts
hackingKK wrote: > Hello all. > I have been using the twisted library for quite some time and I must say > it is the best library for xmlrpc. > I have a tcp server listening on a port and I use reactor.run() to start it. > Now I want to learn how to daemonise the entire code. […] > So I just want

Re: [Twisted-Python] Twisted Plugins - Implementation Discussion

2011-04-07 Thread Andrew Bennetts
Itamar Turner-Trauring wrote: […] > So, the design has to *not* rely on caching working. FWIW: this is an achievable goal. I have 32 different bzr plugins currently installed, and here's the difference they make: $ time bzr --no-plugins rocks It sure does! real 0m0.075s $ tim

Re: [Twisted-Python] Gtk2Reactor: what are the reasons for avoiding GLib functions?

2011-04-05 Thread Andrew Bennetts
Jason Heeris wrote: […] > "glib handles timeouts much less efficiently than any of the existing > Twisted reactors. Letting glib take care of these would probably make > the glib-based reactors unusable for applications with many timeouts." > > Is there a benchmark or piece of code somewhere that

Re: [Twisted-Python] Where is buildslave configuration?

2011-04-04 Thread Andrew Bennetts
anatoly techtonik wrote: […] > Why? I changed version to check that bin/trial uses the correct > twisted checkout (which it didn't), and to my surprise `bin/trial > --version` still gave me the number before it was edited in both > checkout and working copy. That was weird, because in my working co

Re: [Twisted-Python] Creating a hybrid server in Twisted

2011-04-04 Thread Andrew Bennetts
Jashank Jeremy wrote: [...] > So I'm pretty much stuck in a rut. I don't want to totally reinvent the > wheel just to be able to protocol-switch; I'd prefer to make use of > existing code from Twisted. How do I hijack Twisted.Web to add protocol > switching? You could override lineReceived along

Re: [Twisted-Python] Failure is O(state) vs Exception

2011-03-30 Thread Andrew Bennetts
Glyph Lefkowitz wrote: […] > Agreed. I've seen this behavior crop up shocking close to the top of profiles > for Calendar Server as well, so I'm very glad to hear you've undertaken this > work. The current default is almost certainly wrong; the only code which has > practically ever used it was t

Re: [Twisted-Python] Failure is O(state) vs Exception

2011-03-30 Thread Andrew Bennetts
John Arbash Meinel wrote: […] > I think walking the frames and copying the dicts is also expensive. That > is what the bug you linked to me was about. (First, walking everything > and using __dict__.copy() was a bit expensive, and second that the > safe_repr() calls were turning 1GB strings into a

Re: [Twisted-Python] Failure is O(state) vs Exception

2011-03-30 Thread Andrew Bennetts
John Arbash Meinel wrote: […] > > Just for the record, changing cleanFailure to not do its operation is > > likely to lead to big memory leaks. The second thing you did, setting > > self.tb to None, makes more sense to speed things up. > > Right. I agree that it is a better solution. I was wonderi

Re: [Twisted-Python] [Twisted-web] Question regarding callLater() and service creation

2011-03-10 Thread Andrew Bennetts
This thread belongs on the twisted-python@ list, rather than twisted-web@, as it has nothing to do with twisted.web. Eric Chamberlain wrote: > I'm creating a service using Twisted. It has nothing to do with > networking (I know that Twisted is an event-driven networking > engine... stay with me h

Re: [Twisted-Python] Question regarding the working of twisted python with celery

2011-03-03 Thread Andrew Bennetts
Dinesh Kapoor wrote: [...] >4. When celery is run with concurrency of 2, then I tried printing out the >process ids of calling process in the reactor code, and I am getting 2 >different pids, so I am assuming there are two seperate copies of reactor >in those separate tasks. This s

Re: [Twisted-Python] Task-based documentation started

2011-02-01 Thread Andrew Bennetts
Tom Davis wrote: [...] >* .rpy scripts are for deployment, not debugging; I was a little > concerned seeing that bullet point on the outline. �(See > > <[2]http://twistedmatrix.com/documents/10.2.0/web/howto/web-in-60/rpy-scripts.html>.) > >Huh? The docs you link to

Re: [Twisted-Python] High-level view of Twisted

2011-01-31 Thread Andrew Bennetts
Jason Heeris wrote: [...] > 2. What is a Factory, anyway? What are they *for*? says: In general, an object that constructs other objects. In Twisted, a Factory usually refers to a twisted.internet.protocol.Factory,

Re: [Twisted-Python] Using SerialPort with t.a.s.Application

2011-01-29 Thread Andrew Bennetts
Glyph Lefkowitz wrote: [...] >The whole idea of a glossary concerns me a little bit.  … However, Twisted >does have its own jargon and a dictionary to help the novice parse it would >be a good thing. >What I'd really like to see in this regard is to make sure that every >"jargo

Re: [Twisted-Python] Conch as a file transfer server

2010-11-07 Thread Andrew Bennetts
Jonathan Lange wrote: > On Sun, Nov 7, 2010 at 12:09 PM, Laurens Van Houtven > wrote: > > Okay, tried to learn something out of that. If I understand correctly > > SSHSession is the low-level thing that actually handles SSH-specific > > gunk, and ISession is the customizable thing. File transfer

Re: [Twisted-Python] How to exit a twistd program with a status code ?

2010-09-24 Thread Andrew Bennetts
David Cournapeau wrote: > Hi, > > I have a program run through twistd, and would like to exit with a non > zero status code on some error. I have a callback which stops the > reactor and then sys.exit(some_value), but twistd still seems to catch > the SystemExit exception after calling for reactor

Re: [Twisted-Python] how to implement sleep?

2010-09-19 Thread Andrew Bennetts
ruslan usifov wrote: >Hello > >Twisted is great, but how cant i emulate sleep behaviour in syested. I -Andrew. ___ Twisted-Python mailing list Twisted-Pytho

Re: [Twisted-Python] Announcing Twisted 10.1.0pre2!

2010-09-12 Thread Andrew Bennetts
Thomas Hervé wrote: [...] > > * Deferred.setTimeout has finally been removed. Hooray! -Andrew. ___ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Re: [Twisted-Python] Question about XMLRPC, Sync and ASync

2010-08-07 Thread Andrew Bennetts
Andrew Francis wrote: [...] > I am a little confused about the basic.LineReceiver because I thought > that was used for creating server protocols? Why would you think that? It's a perfectly good basis for implementing the client or server side of a line-based protocol. For example, the SMTP serv

Re: [Twisted-Python] Uses of StringIO instead of cStringIO

2010-07-21 Thread Andrew Bennetts
Albert Brandl wrote: > Hi! > > There are several modules in twisted that import StringIO instead of > cStringIO (e.g. twisted/mail/maildir.py, twisted/news/nntp.py, > twisted/web/script.py). Are there any reasons why they use the slower > variant implemented in Python instead of the C variant? >

Re: [Twisted-Python] conceptually, why a deferred can't be used more than once?

2010-07-08 Thread Andrew Bennetts
Jean Daniel wrote: > Dear list, > > Concerning the concept of the deferred, why is it more useful to go > with a deferred which gets consumed and can only be fired once? Because they are basically a way to provide asynchronous function calls. In plain Python a function call only returns (or rais

Re: [Twisted-Python] making Screwtape (Tim Allen) a committer

2010-06-09 Thread Andrew Bennetts
Glyph Lefkowitz wrote: > I think we should give screwtape an SVN account and make him an official > reviewer. He's been doing a lot of work on the distutils code which would be > made easier by that, and he's been doing pretty decent reviews. +1 I've been thinking (and occasionally saying) this

Re: [Twisted-Python] How do I get xUnit output from trial for Hudson?

2010-05-08 Thread Andrew Bennetts
Chris Withers wrote: > Jonathan Lange wrote: > > Not very. > > > > "trial --reporter=subunit | subunit2junitxml" works well for me, > > although I am running on an OS that supports pipes :) > > ...and on which subunit compiles ;-) > > *cough*notwindows*cough Have you tried it? AFAICS, subunit

Re: [Twisted-Python] win32com client in a twisted thread

2010-05-03 Thread Andrew Bennetts
Don Dwiggins wrote: > I'm running a Windows service with Twisted (xmlrpc), and I've run into > an odd case. > > In a recently implemented method, I create a COM object with > win32com.client.Dispatch (using a COM DLL that's part of the overall > application) and make a couple of calls on it, ge

Re: [Twisted-Python] Question about processes in python

2010-04-13 Thread Andrew Bennetts
Itamar Turner-Trauring wrote: > On Mon, 2010-04-12 at 14:23 -0400, Glyph Lefkowitz wrote: > > > Still, I wouldn't recommend using the subprocess module in a Twisted > > application, and multiprocessing even less. 'subprocess' uses > > select(), which means that if you are running processes in a s

Re: [Twisted-Python] NetstringReceiver

2010-03-28 Thread Andrew Bennetts
exar...@twistedmatrix.com wrote: > On 10:25 am, albert.bra...@weiermayer.com wrote: [...] > >There is a unittest that assumes that dataReceives still works after > >sending in garbage: > > > > def test_illegal(self): > >""" > >Assert that illegal strings cause the transport to be

Re: [Twisted-Python] NetstringReceiver

2010-03-24 Thread Andrew Bennetts
Albert Brandl wrote: > Hi! > > The NetstringReceiver class does not exactly do what I'd expect - see > issue http://twistedmatrix.com/trac/ticket/4378. Since we plan to use > netstrings, I am trying to fix it. > > I am not quite sure how to handle certain problems, though, and that's > where I

Re: [Twisted-Python] Error: filedescriptor out of range in select

2010-03-19 Thread Andrew Bennetts
Don Schoeman wrote: >Hi guys, I have started having this problem a few weeks ago and it >happens about once a week after which I have to restart my Twisted >based server to function again. It seems to be happening when I >make RPC calls using twisted.web.xmlrpc.Proxy. I have reason

Re: [Twisted-Python] FTP Client - questions

2010-03-18 Thread Andrew Bennetts
Renan Mathias Fernandes wrote: > Hello, > > I am trying to learn/implement a FTP Client, but I am facing a problem: > How can I check if the retrieveFile method has finished downloading a > file? As far as I can see, there is no easy way to do this, am I > incorrect? You a

Re: [Twisted-Python] Twisted and python threading

2010-03-18 Thread Andrew Bennetts
(*)·´`·.¸.»ÐëÄdMäñ·´`·.¸.»(*) wrote: > Hi, > > I'm trying to spawn a threading.Thread from a Twisted application, but > the thread won't start unless I schedule the the code with > reactor.callLater(), any Ideas ? Twisted doesn't affect threading.Thread at all. You haven't given much detail, so

Re: [Twisted-Python] Reactor events help request ..

2010-02-23 Thread Andrew Bennetts
Watson, David wrote: [...] >However, it appears to me that the self.sendLine(msg)  and or the >self.transport.write(msg) writing  functions are blocked >functions waiting for a reactor event to occur at a future scheduled time >before acutally flushing out the internal write buffers

Re: [Twisted-Python] Streaming File Transfer Protocol?

2010-02-13 Thread Andrew Bennetts
Darren Govoni wrote: [...] >2) Can I force twisted to send ALL the bytes I issue in the write without >re-thinking TCP or forcing me to re-implement TCP? Also,

Re: [Twisted-Python] Streaming File Transfer Protocol?

2010-02-13 Thread Andrew Bennetts
Darren Govoni wrote: >I spoke too fast. But pardon my noobiness. > >Ok, so I am using a simple protocol that is listening on a TCP port. > >One the client side, I write 4096 bytes using self.transport.write(bytes) > >on dataReceived side, I get only 1448. > >Now, what I "wan

Re: [Twisted-Python] understanding deferreds

2010-02-02 Thread Andrew Bennetts
Landreville wrote: > On Sat, Jan 30, 2010 at 2:16 AM, Andrew Bennetts > wrote: > > twisted-...@udmvt.ru wrote: > > [...] > >> Is it true, that adding many callback functions as filters is elegant, > >> but impractical solution? > >> Since there is onl

Re: [Twisted-Python] understanding deferreds

2010-01-29 Thread Andrew Bennetts
twisted-...@udmvt.ru wrote: [...] > Is it true, that adding many callback functions as filters is elegant, > but impractical solution? > Since there is only a [linear] list of pairs (callback, errback), the last > errbacks > have to be complex to distinguish the failures, that came from the previo

Re: [Twisted-Python] deferring result to PB a callRemote method

2010-01-18 Thread Andrew Bennetts
Chris Laws wrote: [...] >I think the simple answer to my question is to just return a deferred as >the result to the callRemote("shutdown")�method and trigger it as normal. Yes, that's right. You can return Deferreds from your PB server's methods. So long as the eventual result is someth

Re: [Twisted-Python] A pseudo-deferred class that can be canceled

2010-01-04 Thread Andrew Bennetts
Terry Jones wrote: > I just wrote the below for fun. It's untested :-) > > It's a class that you initialize with a callable (f), and which gives you > back a deferred (d) that will fire when f fires. Alternately, you can fire > d yourself by calling 'callback' or 'errback' on the class instance a

Re: [Twisted-Python] order of remote requests

2009-12-29 Thread Andrew Bennetts
Wolfgang Rohdewald wrote: [...] > I should have given more details, sorry. > > I am writing both the server and the client with twisted pb. > The server (a game server) sends messages to four player clients. > > Say the game server sends messages A and B to a player client. > > Is it granted th

Re: [Twisted-Python] order of remote requests

2009-12-29 Thread Andrew Bennetts
Wolfgang Rohdewald wrote: > Hi, > > when I send two remote calls A and B over the network, in that > order, using the twisted perspective broker callRemote method, > is it granted that A is processed first on the other side even > if B arrives first? Or should I only send B after I got an > answe

Re: [Twisted-Python] Question about TAC apps and TCPClient/Server vs reactor.connect/listenTCP

2009-12-21 Thread Andrew Bennetts
Paul Goins wrote: [...] > > Any suggestions of how to do this? Should I be specifying only "core" > stuff as services of the application object, and connecting the others > via reactor.connectTCP/listenTCP as needed? Can I add to and remove > services from the application object once the reactor

Re: [Twisted-Python] zope.interface

2009-12-14 Thread Andrew Bennetts
Tim Allen wrote: [...] > It occurs to me that recent discussions about splitting Deferreds off > into their own library might consider zope.interface as a model. Has it > prospered, as separate library? Does anyone besides Zope and Twisted use > it? I don't know, but it might be worth finding out.

Re: [Twisted-Python] How to chain deferred calls

2009-10-22 Thread Andrew Bennetts
vit...@synapticvision.com wrote: [...] > def abc1(self): > if t.test() is None: >raise Exception("Error11") > else: >d = defer.Deferred() >d.callback(1) >return d > > > and basically, I've expected in case of exception > self.handleFailure1() to be call

Re: [Twisted-Python] How to find out if exceptions are being raised in your errBack?

2009-10-14 Thread Andrew Bennetts
Glyph Lefkowitz wrote: [...] >I'm answering a question you didn't ask, about logged errors, because I >think it's the one you meant to ask.  The answer to the question you are >actually asking here, i.e. "how do I handle errors in an errback", is >quite simple: add another errback. 

Re: [Twisted-Python] sleeping in inlineCallbacks

2009-10-07 Thread Andrew Bennetts
Mikhail Terekhov wrote: >On Wed, Oct 7, 2009 at 6:04 PM, Phil Christensen <[1]p...@bubblehouse.org> >wrote: > > Paul's example will work just fine. Also, AFAIK there's no existing > twisted function to do replicate an asynchronous sleep() in this way. > > -phil > >What

Re: [Twisted-Python] Lots and lots and lots and lots... of deferreds

2009-10-06 Thread Andrew Bennetts
Steve Steiner (listsin) wrote: [...] > I expect the usual flurry of "you must post your exact code or we > can't help you at all, moron" posts, but... I'll try to restrain myself ;) > In spite of my not having posted specific code, could someone with > some actual experience in t

Re: [Twisted-Python] AlreadyCalledError trying more than a server

2009-09-30 Thread Andrew Bennetts
Antonio Beamud Montero wrote: > exar...@twistedmatrix.com escribió: > > I don't think you've shared enough of your code for anyone to figure out > > what you're doing wrong (aside from calling one Deferred's callback > > method more than once). Your "runall" function above looks okay, so > > pe

Re: [Twisted-Python] Chaining deferreds - Twisted+PyGtk

2009-07-15 Thread Andrew Bennetts
Łukasz Rekucki wrote: [...] >Is this a thread related problem ? Am I doing something terribly wrong by >calling a deferred from the gtk thread ? Twisted in general is not thread-safe. If you need to call Twisted code from a thread other than the one you started the reactor in, use reactor

Re: [Twisted-Python] connectionLost not always getting called?

2009-01-11 Thread Andrew Bennetts
Rob Bredow wrote: [...] > web-browser does not always trigger a connectionLost call. I tracked down one > specific instance yesterday where the server thought the client was still > connected even though the client had been gone for 30+ minutes--but after a > few > hours the server noticed that t

Re: [Twisted-Python] A question about ITransport.write()

2008-12-27 Thread Andrew Bennetts
Lian Cheng wrote: > Hi, all > > As a Twisted newbie, I read the Twisted documentation, and found that: > > 1. ITransport.write() doesn't return a deferred. > 2. IProtocol doesn't have a dataSent() callback or something alike. > > Since ITransport.write() is a non-blocking call, how can I be inf

Re: [Twisted-Python] Weekly Bug Summary

2008-12-21 Thread Andrew Bennetts
gl...@divmod.com wrote: > > On 05:05 am, exar...@twistedmatrix.com wrote: >> Bugs opened: 12Bugs closed: 13 Total open bugs: 1055 (-1) > > > Every week I see this number is negative (even if only a little) I do a > little victory