Re: [Twisted-Python] Python3 twistd daemon for Ubuntu 14.04 alternatives

2017-02-22 Thread steven meiers
i could be totally wrong, and please correct me if i am, but try this: target: this will give you a current twisted / python installation and keep the packages seperate from the system ones # 1. install a package called virtualenv and pip on your system apt install virtualenv pip # 2. create a

Re: [Twisted-Python] trial cant find my class, example from twisted docs

2017-02-21 Thread steven meiers
Am Montag, den 20.02.2017, 18:16 -0800 schrieb Glyph Lefkowitz: > > On Feb 20, 2017, at 5:02 AM, steven meiers > > wrote: > > > > any idea why this does not work? > > Most likely you are being bitten by the recent change to not add '.' > to sys.path a

[Twisted-Python] trial cant find my class, example from twisted docs

2017-02-20 Thread steven meiers
hi, up to now ive only used the python unittest for my code, but now i would also like to test the twisted part. so i followed: http://twistedmatrix.com/documents/current/core/howto/trial.html but i get this error: (venv) julius@t560:~/code/python/twisted/basics$ trial calculus calculus ...  

Re: [Twisted-Python] twisted eats the error

2017-02-13 Thread steven meiers
> > [SNIP] > > The “Unhanded error in Deferred” isn’t coming from your call to > deferToThread, it is coming from your task.LoopingCall.  When you > invoke .start() on your LoopingCall instance, it returns a Deferred, > which fires its assigned callback handler when you call .stop() on > the Loo

Re: [Twisted-Python] twisted eats the error

2017-02-13 Thread steven meiers
> Sorry, your code example and your explanation don’t make clear what > you expect to happen, and when.  When you say “the first method that > is called from my code”, are you referring to  aSillyBlockingMethod, > or runEverySecond?  In the deferToThread case, you are calling the > former; in the

[Twisted-Python] twisted eats the error

2017-02-13 Thread steven meiers
hi, there is a abvious error in the code at the end. since i know next to nothing about threads i thought maybe a print statement in the code that is actually doing the work would give me some pointers. if im not mistaken, it is: def callWithContext in python/context.py as it turns out it does

[Twisted-Python] twisted code works, after importing it does not anymore

2017-01-17 Thread steven meiers
hi, this websocket code works but now i would like to be able to import it to another class to have a way to send messages without waiting for the answer. the code is below here and also pasted here: https://bpaste.net/show/78 36ba3b8008 for some nice syntax highlighting. just running websock

Re: [Twisted-Python] understanding twisted, better error handling

2017-01-11 Thread steven meiers
Am Montag, den 09.01.2017, 23:12 -0800 schrieb Glyph Lefkowitz: > > > > On Jan 9, 2017, at 5:20 PM, steven meiers > > wrote: > > > > the error does come up when you give agent.request a "GET" instead > > of a > > b"GET". >

Re: [Twisted-Python] understanding twisted, better error handling

2017-01-10 Thread steven meiers
Am Montag, den 09.01.2017, 23:12 -0800 schrieb Glyph Lefkowitz: > > > > On Jan 9, 2017, at 5:20 PM, steven meiers > > wrote: > > > > the error does come up when you give agent.request a "GET" instead > > of a > > b"GET". >

[Twisted-Python] understanding twisted, better error handling

2017-01-09 Thread steven meiers
hi, i use twisted to send a web request over a proxy, this works over treq.get(url, agent=myagent) without problems. but in the process (started out with agent.request) i could not figure out from what line of twisted code this error: [Failure instance: Traceback (failure with no frames): : []

Re: [Twisted-Python] treq POST abborting with: err: ('Could not adapt', '{"....", "..."} )

2017-01-07 Thread steven meiers
thanks for the quick replys guys, you were right. a .encode('utf-8') helps. actually the json.dumps part in the code is wrong. it has to be:   somepage = yield treq.post(target_url, body.encode('utf-8'), headers=headers, cookies=cookies ) Am Samstag, den 07.01.2017, 12:00 + schrieb Cory Ben

[Twisted-Python] treq POST abborting with: err: ('Could not adapt', '{"....", "..."} )

2017-01-06 Thread steven meiers
hi, sending a simple post request with a body (cookies) results in a error here. im using python 3.x with the latest twisted and treq installed via pip in a virtualenv. the code gets a chatroom login page, extracts two values, gets the cookies and logs a user into the chat. (incomplete) thing

[Twisted-Python] treq POST abborting with: err: ('Could not adapt', '{"....", "..."} )

2017-01-06 Thread steven meiers
hi, sending a simple post request with a body (cookies) results in a error here. im using python 3.x with the latest twisted and treq installed via pip in a virtualenv. the code gets a chatroom login page, extracts two values, gets the cookies and logs a user into the chat. (incomplete) thing