Lukasa reviewed <https://tm.tl/#8530> - Delete test_webclient.py's testPartial() test, which is being skipped (assigned to rodrigc)
t0mb0_ joined the channel
new core enhancement https://tm.tl/#8532 by adiroiban: Push coverage report from Travis-CI
vrederv joined the channel
insp3ori0n joined the channel
insp3ori0n
hey guys :) jjust a little question. can i send files with self.transport.write just out of the box or do i have do decode them in some way?
LionsMane joined the channel
jstanley_ has quit
jstanley joined the channel
clokep
insp3ori0n: That's probably not a super simple question...you can probably *generally* do it (especially if it's a binary file), otherwise you'll need to deal with some sort of text encoding.
(Although if you can control both sides that's not hard.)
insp3ori0n
clokep: i managed it now easily with file = open(...), data=file.read()... but in case of, for example pdf files this would not work
clokep
Why not?
Data is just data...
insp3ori0n
i think they cant be transfered to a string or im wrong?
clokep
with open(..., 'rb') as f: self.transport.send(f.read())
insp3ori0n
works with pdfs too?? good to know
clokep
insp3ori0n: Twisted works on "bytes" which is called "string" in Python 2, "bytes" in Python 3, essentially just a collection of data with no understanding of what it is underneath.
So if oyu send it and then save it back to a pdf on the other end, it should work OK.
it's a web app, perhaps you would call it a web server
it has some logic that does some requests elsewhere, and computes a result based on that and returns it
some of its requests are built using NOT_DONE_YET
what are my chances of transitioning to WSGI ? (the point of this would be to deploy the app with uWSGI and be able to take advantage of the reload/restart triggered via memory utilization that uWSGI provides. because for some reason, the twisted app I wrote, leaks memory, and I am not fully confident that I'll be able to tame those leaks in due time, so I need it to be combed up and reloaded/restarted when it goes over a certain limit, for example
I am asking this in relation to a quote in the documentation, which says "Like any other WSGI container, you can’t do anything asynchronous in your WSGI applications, even though this is a Twisted WSGI container.
"
This quote somehow makes me feel that the async requests I'm doing in the twisted app (via twisted.web.client , specifically Agent) will be neutralized and forced to synchronous mode if I were to transition the twisted app to WSGI
I'm not sure if there's any truth to that, maybe someone else would like to weigh in
So, I have a program that makes HTTP requests with twisted's Agent and we're moving to HTTPS, but with a self-signed certificate. I made it work with a custom ClientContextFactory, but how would I go about making it work properly, without completely ignoring the certificate
?
iffy has left the channel
jstanley has quit
jstanley joined the channel
terrycojones joined the channel
mesozoic joined the channel
mesozoic_ has quit
dpn`
adourado, i'm pretty sure treq has answered this question, maybe check it out
is always takes me a significant amount of time to get ampoule working after I haven't used it for a while :(
child processes seem to be exiting without getting a chance to do anything
ardu_ joined the channel
benbangert
the joy of trying to clean the reactor of cached connections from the http Agent.....arrrrrrrgghghhhhhhh
dpn`
benbangert, if you're using the default pool there's a secret global thingy isnt there?
wait.. that's in treq
I just assume everyone uses it :P
if not, maybe you could rip it off from there
benbangert
I've had to dig through so many damn secret attributes to grab this connection pool. lol
dpn`
haha yeah that sounds familiar
benbangert
a ridiculous amount of time spent just to shut it down, its kind of insane
ah, well, I did finally reach the connection pool, though for some reason the underlying tcp client is alive, no idea why, but twisted trials is still unhappy about reactor
dpn`
ah... the whole request wrapped in a request thing
trying to find the one with the actual transport on it :/
adourado
dpn`: who/what is treq, and how do I check it out?
benbangert
yea, maybe. thinking at this point of just grabbing the selectables off the reactor and nuking them