#twisted

/

      • kenaan
        Tickets pending review: https://tm.tl/#9299, #9305, #9333, #9337, #9338, #9340, #9343 (rodrigc), #9350 (ktdreyer), #9352, #9210 (markrwilliams), #9358, #8966 (the0id), #9100, #9118 (the0id), #4964 (jameshilliard), #9138, #9176, #7495
      • welcomeback_rr has quit
      • marius joined the channel
      • marius has left the channel
      • energizer joined the channel
      • LichtMacher has quit
      • energizer joined the channel
      • energizer has quit
      • energizer joined the channel
      • energizer has quit
      • energizer joined the channel
      • nchambers
        is twisted.protocols.basic.LineReceiver ok to use with clients or is it just for servers?
      • hmm, nmd. if I'm reading the docs right it should be fine. problem must be elsewhere
      • seanicus
        Yeah it's good for both.
      • nchambers
        ok, so new question then. what am I doing wrong with sending data here: https://github.com/ntchambers/cherrybomb/blob/m... I get this error: http://ix.io/Dqm
      • seanicus
        I think it's self.sendLine
      • but i didnt lookat your code. hold on
      • nchambers
        it is
      • writeLine is my own thing that calls sendLine
      • seanicus
        ah, gotcha
      • nchambers: I don't understand why you are pretty much alias'ing sendLine to writeLine
      • nchambers
        honestly it was just to separate everything to see if I could spot the issue
      • seanicus
        I'm kinda confused why it says self.transport doesnt have a write method
      • gah, let me download
      • nchambers
        yeah I don't understand what its complaining about
      • seanicus
        Ehhh I dont have the other files
      • well
      • just separate out the other values
      • get rid of writeLine
      • nchambers
        I was getting the error before that
      • seanicus
        Don't care. Isolate variables.
      • make it as simple as you can
      • print out values
      • nchambers
        I had it and again have it as simple as possible
      • self.sendLine('whatever') still throws the same error
      • print prints out expected values
      • seanicus
        I'm looking at code I wrote and uhh it works fine
      • I'm really confused
      • nchambers
        my ident server uses the same code more or less, and it works fine
      • seanicus
        self.sendLine("PROTOCTL EAUTH={}".format(self.factory.name))
      • Maybe you overwrote something?
      • nchambers
        oh my protocol can't access factory
      • could that be the problem?
      • seanicus
        pretty sure it cant be that
      • nchambers
        I have no idea what I'm doing wrong then
      • seanicus
        comment out everything in Irc and in __init__ jujst put self.sendLine("whatever")
      • see if it still breaks then
      • nchambers
        yep still breaks
      • njs
        isn't the .transport attribute added after __init__ runs?
      • nchambers
        o.o
      • seanicus
        ohhh is that it?
      • njs
        maybe move the call into connectionMade
      • seanicus
        so is it because
      • Ah, excellent point
      • Yeah I didn't even make that connection. connectionMade is typically used as the initializer for Protocols
      • also nchambers, just so you know, there's a specific IRC module for twisted
      • nchambers
        meh
      • I'd rather implement my own
      • thanks for the heads up though
      • seanicus
        well
      • I'm sorta-kinda implementing an IRC server
      • twisted kinda doesnte ven give the bare minimum to do this
      • but it does make it a lot easier
      • what with the prefix and params arguments
      • I recommend not reinventing the wheel
      • nchambers
        thanks for the recommendation. Still not going to use it
      • but I appreciate the heads up
      • seanicus
        why tho
      • nchambers
        because I want to write my own?
      • seanicus
      • You can not say "I am feeding the dog because I am feeding the dog"
      • I am asking why you want to write your own.
      • I dont' really care your actual reasoning. I just hope it's for a good reason
      • nchambers
        because I do. I didn't realize I needed a reason to use twisted
      • seanicus
        again, that's beggining the question
      • And you can simply say "because I enjoy the challenge"
      • nchambers
        not really. you're just pestering for a reason when none exists
      • seanicus
        or "to learn how to make my own protocol"
      • nchambers
        you're overthinking this
      • seanicus
        Everything anyone does is for a reason.
      • nchambers
        you're welcome to that opinion
      • seanicus
        So...you're doing it for a shitty reason.
      • nchambers
        or I'm not really doing it for any reason at all and you're overthinking it
      • seanicus
        Making more work for yourself, deliberately slowing yourself down
      • Hey man, it doesn't matter to me. Don't get so defensive when someone is trying to help you. It's an important trait as a programmer to recognize when you're making unnecessary work for yourself, is all.
      • seeya
      • nchambers
        I'm not being defensive at all. I'm giving you the answer and you clearly don't want to accept it
      • if it doesn't matter to you, just stop asking then :)
      • NoImNotN1neVolt
        reinventing the wheel is awesome.
      • if people didn't reinvent the wheel, we'd have bugatis on stone discs.
      • seanicus
        Good point, haha
      • NoImNotN1neVolt
        some of my earliest hobby projects (as a self taught coder) were pointless reinvent-the-wheel type things. screensavers, irc clients, email clients, etc.
      • some people learn well with hands-on experience, even if they're "doing it wrong" (i definitely was, in hindsight), etc.
      • also, happy festivus, etc.
      • seanicus
        Yes, I agree with that. I think doing it as a learning exercise is valid.
      • But projects done as learning exercises tend not to be coded as well as the already-invented-wheel
      • kenaan
        Tickets pending review: https://tm.tl/#9299, #9305, #9333, #9337, #9338, #9340, #9343 (rodrigc), #9350 (ktdreyer), #9352, #9210 (markrwilliams), #9358, #8966 (the0id), #9100, #9118 (the0id), #4964 (jameshilliard), #9138, #9176, #7495
      • NoImNotN1neVolt
        totally agreed.
      • though occasionally they do provide a sandbox for experimenting with new approaches to already-"solved" problems, etc.
      • njs
        it is also possible to do things for fun
      • rather than insisting that everything must accomplish some economically productive use either directly or indirectly (e.g. learning)
      • however this attitude is distinctly suspicious and un-American
      • seanicus
        yes for learning or fun, either answer i would have been more satisfied with than
      • "because i wanted to"
      • heftig joined the channel
      • slav0nic joined the channel
      • LichtMacher joined the channel
      • kenaan
        Tickets pending review: https://tm.tl/#9299, #9305, #9333, #9337, #9338, #9340, #9343 (rodrigc), #9350 (ktdreyer), #9352, #9210 (markrwilliams), #9358, #8966 (the0id), #9100, #9118 (the0id), #4964 (jameshilliard), #9138, #9176, #7495
      • njs
        seanicus: it is still kind of rude to demand people explain their motivations and then judge them for not meeting your standards
      • sveinse joined the channel
      • sveinse
        What is a reliable method of checking twisted's version, so that I can fail my app is it is too old?
      • tos9
        sveinse: pinning from below in your setup.py
      • sveinse
        tos9: sure, but that moves the resposibility down to the package level. Do I understand this that is implies that one usually don't do application based version checks?
      • tos9
        sveinse: correct
      • sveinse
        using linter is a two edged sword :o :). Especially when twisted use camel cases...
      • seanicus
        njs: not demanding, just asking, then subsequently getting annoying that he gave me a nonanswer
      • drebs joined the channel
      • drebs
        hi, i'm researching about the use of PyPy and twisted, and reached this 5 year-old bug: https://twistedmatrix.com/trac/ticket/6278
      • someone knows if there's been any advances in either getting benchmarks for this or if PyPy might have changed in any way that made the issue less problematic?
      • (i don't really understand the whole issue at hand yet :)
      • tos9
        drebs: Don't know if anything's changed, but I (we've) been running Twisted on PyPy in production for awhile now, and others (like twisted's webpage itself) for even longer, if you're asking a more general question.
      • drebs
        tos9, do you make heavy use of inlineCallbcacks?
      • it seems that this is the possible problematic point, because of the way defer.returnValue is implemented
      • iffy joined the channel
      • drebs has quit
      • iffy has left the channel
      • sveinse
        Will callLater(0,fn) run the fn immediately, as in when callLater(0,..) returns the fn has been run? Or does it schedule the fn to run immediately once the execution comes back to the event loop?
      • drebs joined the channel
      • tos9
        drebs: I don't, I try to avoid it for other reasons (it makes diagnosing errors harder)
      • But one or two places in prod code use it, and those places are likely hot, so yeah it is in some sort of use
      • sveinse: I forget, but I think the latter
      • sveinse: should be reasonably easy to check if callLater special cases 0 (or with a debugger)
      • drebs
        tos9, thanks a lot for the info
      • tos9
        np
      • kenaan
        Tickets pending review: https://tm.tl/#9299, #9305, #9333, #9337, #9338, #9340, #9343 (rodrigc), #9350 (ktdreyer), #9352, #9210 (markrwilliams), #9358, #8966 (the0id), #9100, #9118 (the0id), #4964 (jameshilliard), #9138, #9176, #7495
      • epopt joined the channel
      • xpot joined the channel
      • LichtMacher has quit
      • jkvossen joined the channel
      • mat^2 joined the channel
      • sveinse
        Is there a global way to catch or hook errors that occurs in the functions of callLater or loopingCall? I.e. be notified of unhandled exceptions in Deferred objects?
      • The challenge with the behaviour is that a Deferred that fails, dumps its traceback to stderr and stops, but overall the reactor continues as nothing has happened. I the application could be notified, it could take appropriate action
      • teratorn
        sveinse: if you know how to do that then just add the appropriate errbacks :)
      • sveinse: the problem with this is that you can't know if a Deferred is actually dead or not, until it gets garbage collected and is found to be failed.
      • because code could always add an errback later, and then the Deferred would have a value again
      • sveinse
        teratorn: firstly, in callLater() or loopingCall() I'm oblivious to the backend implementation using Deferreds. Secondly, I do agree, you could and perhaps should try catch everything that can go wrong, but that creates quite bloated code in a large application
      • LichtMacher joined the channel
      • It would be nice if there were a reactor hook when a errback is being collected without a handler. This way the application could be informed that something is not right
      • teratorn
        erm, Deferred has an __del__ method that prints the unhandled error in Deferred...
      • that is where Unhandled error in Deferred comes from. it happens at GC time