IRC Logs for #circuits Monday, 2013-08-12

*** mfdl has quit IRC01:05
jgiorgiasynchronous chat ftw!02:01
prologichaha :)02:15
prologicwhen you're always online via znc02:16
prologicyou can be guaranteed that I'll respond eventually :)02:16
prologicat least within 12hrs :)02:16
jgiorgilol same here, most of the time02:19
jgiorgiprologic, you pinged earlier?02:38
prologicnah all good :)02:38
*** sz0ka_ has joined #circuits03:20
*** mfdl has joined #circuits03:21
*** mfdl has quit IRC03:26
*** sz0ka_ has quit IRC03:52
*** mfdl has joined #circuits04:45
*** mfdl has quit IRC06:08
*** Osso has quit IRC07:19
sz0kaor like we say in germany: Moin :D!07:48
prologicmoin moin07:49
sz0kaprologic: heh :D07:49
sz0kaErm I found something like an error but it isn't really an error07:49
sz0kaour ssl is broken (on cospace), so I use HTTPConnection from httplib and change the socket with a ssl socket and a protocol, that works07:50
sz0kai thought about implementing something like that in the circuits client but wanted to get a feedback on this first07:51
sz0kawould you merge this or do you think that this is not necessary?07:51
prologicdoesn't it already support ssl?07:53
prologiccircuits.web.client that is07:53
prologicbecause the underlying TCPClient component should already support ssl07:53
sz0kait seems to work but we got a broken ssl version on our servers07:56
sz0kaso i have to use one, that works07:56
sz0kaw8 i'll write a PoC to make it a bit clearer07:57
prologichow are you getting around it then?08:01
sz0kai'll show you08:02
sz0kasslv3 works08:10
sz0kabut sslv23 not08:10
sz0kaprologic: you set sslv23 as default08:11
sz0kain the httpclient08:13
sz0ka(i checked that yesterday=08:13
prologicoh ok08:19
prologicand what's the fix?08:19
prologiccan't we make the version configurtable?08:19
sz0kayeah this was what i was thinking about :D08:36
sz0kaI'm ready to implement ;D08:36
prologiclook forward to the pull request :)08:44
sz0kaperfectly :D08:47
*** ninkotech has joined #circuits08:49
sz0kaprologic: erm how would i test my code?08:57
sz0kai need to install it in a virtualenv, correct?08:58
sz0kagroovy :309:00
sz0kathis is what i get whenever i try to connect to a  ssl host09:44
sz0kait takes the correct version (PROTOCOL_SSLv3), but the handshake fails09:49
ninkotechsz0ka: installing in virtualenv works best for most needs :)10:00
sz0kaheh yeah tested it10:01
sz0kait works cool10:01
ninkotechi cant really help you with that ssl handshake error10:02
sz0kadamn it ^^10:02
sz0kabut ty anyway10:02
ninkotechi will play with ssl soon :)10:02
sz0kai think this is some kind of problem prologic hast do fix10:02
sz0ka*has to10:02
sz0kaninkotech: no don't it's a pain!10:02
ninkotechi know...10:02
ninkotechi like to eat the biggest frog in the morning10:03
ninkotechafter that, there is nothing as bad for whole day10:03
sz0kaninkotech: except it is still the biggest frog at the end of the fucking day ;D10:05
ninkotechi have bigger ones here :D10:06
ninkotechsz0ka: get the frog before the frog will get you10:06
ninkotechit tends to grow10:06
sz0kaargh brb smoking10:07
*** sz0ka_ has joined #circuits10:15
sz0kaprologic: okay I tried and tried to figure out wtf happens but im stuck..10:27
sz0kado_handshake seems to be broken or some kind of that10:27
prologicyeah virtualenv is good for isolation10:29
prologicpip install pytest10:29
prologiclook at other unit tests10:29
prologicpretty asy10:29
ninkotechtesting rocks10:30
ninkotechi mostly used std unitests or  nose10:30
ninkotechsz0ka: if you are not familiar with it, read some book about test driven development10:30
prologicyeah I prefer pytest10:30
prologicbecause it makes your tests implier10:31
prologicand more pythonic10:31
ninkotechi something important came up in last 10 years, thats TDD10:31
prologicin the simplest case10:31
prologicdef test_foo():10:31
prologic   assert 1 == 110:31
ninkotechi can imagine writing the testcase boilerplate sucks10:31
prologicpytest is the reason circuits has over 230+ unit tests10:31
ninkotechbut i dont mind doing it10:31
prologictesting is so easy10:31
prologicI do :)10:32
ninkotechits not only easy, its important !10:32
prologicI hate boilerplate10:32
prologicthe less boilerplate the better10:32
ninkotechi agree :)10:32
ninkotechbut i didnt touch pytest much yet10:32
ninkotechbtw writing tests not only gives confidence, it also helps with refactoring10:32
ninkotechand it helps you to FOCUS on what should be done10:33
ninkotechif you write your tests ahead of code10:33
ninkotechi tend to think focus is the biggest problem in software development10:33
ninkotechits the only thing you can control in your project10:33
ninkotechand you should!10:34
ninkotechmore people/money will not help to make it done10:34
sz0kayeah testing is really cool10:35
sz0kabut the question was more aimed to ask in general how to test the code i'm producing10:35
ninkotechsz0ka: unit tests, functional tests10:35
sz0kabut atm, it doesn't matter 'cuz something is fucked up and i can't find out what10:35
ninkotechkeep them separated to be able to make unit tests fast10:36
sz0kaninkotech: i always break down my tests to some kind of atomic test10:36
sz0kaso one test tests one function/method10:36
ninkotechyes, thats unittest10:36
ninkotechbut if your software is larger, functional tests will be needed too10:37
ninkotechesp. if network latency will come into play10:37
sz0kado you suggest any documents on that topic?10:37
ninkotechor distributed async problems :D10:37
ninkotechsz0ka: functional tests test whole system, not just some part of it10:37
ninkotechlike user would do10:37
sz0kaoh than I wrote a framework for doing so for our api10:38
ninkotechunit test  = testing small unites10:38
ninkotechhaving api  makes it easier, right10:38
sz0kaprologic: erm I've got a question you add self._sock to the poller BEFORE doing the ssl thing and after ssling the socket you don't add this one to the poller10:39
sz0kais this the correct behaviour or should the socket added as Reader which is our final socket ._.?10:40
sz0kaso instead of self._sock the self._ssock10:40
sz0kathis is exactly my problem10:42
sz0kabut in 2.7.510:42
prologicsz0ka, that's probably bad :)10:45
prologicmaybe a bug in our code10:45
prologicI think you are right10:45
prologictry it and see10:45
prologicpull requests welcome :)10:45
prologicand thank you!10:45
sz0kano problem10:45
sz0kaerm so the solution is doing self._sock.getpeername()?10:45
sz0kathey are kidding, right?10:46
sz0kawtf does python there under the shelf?10:46
sz0kaprologic: so what do you suggest? getpeername is also fucked, socket says not connected O.o10:48
sz0ka(not connected to endpoint11:01
sz0kahave a look at this, is this helpfull?11:41
sz0kaokay so connect_ex isn't designed for ssl, WHAT THE HELL11:51
prologicafraid I'm too tired tonight :)11:53
prologicI'll leave it with you :)11:53
sz0kaheh okay :D11:59
sz0kaI'll try to find a solution11:59
sz0kaprologic: okay I'll try to rewrite the whole thing without connection_ex12:09
sz0kaargh damn it I'll build my own client xD12:39
sz0kaWith HTTPConnection and swapping the socket everything works flawless12:40
sz0kaprologic: okay this is another hackaround, that would introduce a dependency to circuits.. using pycurl does work for me13:25
prologicnot a good solution :)13:26
prologicneed to keep async properites13:26
prologicand use std libs for ssl13:26
ninkotechi really love requests.org13:28
ninkotechah, those
sz0kaninkotech: requests also gives an error13:31
sz0kaeof violation of protocol13:31
sz0kaprologic: huhm.. okay13:31
sz0kabut this is pain pure13:32
ninkotechsz0ka: best things ever came from big pain13:32
sz0kaninkotech: i thought best things would be just simple ;P13:33
ninkotechyes, for business....13:33
sz0kaactually I'm at work13:33
ninkotechme too13:33
sz0kaand this would support my project I'm working on13:33
sz0kaand i guess my masterchief would like to see wtf i did today :D13:33
ninkotechlife is hard...13:34
sz0kait is, indeed!13:34
sz0kaand it sucks! but fuck it :D!13:34
ninkotechsz0ka: too easy => makes you lazy a lot...13:34
ninkotechhard -> makes you a man13:35
ninkotechnot always, i know13:35
sz0kaninkotech: I've got no chance to really fix it13:35
sz0kai could use HTTPConnection as a client13:35
sz0kafrom httplib13:35
sz0kaand it'd work13:36
ninkotechsz0ka: try something else, do something different today, try again in 2 days. that helped me sometimes13:36
sz0kabut it's blocking :D13:36
sz0kaninkotech: my project consists of making api calls via https13:36
sz0kaand merge the information13:36
sz0kaso i'm fucked until it works13:36
ninkotechlast time i played with ssl, it was few days to make everything right13:36
ninkotechi had to fix libraries, ...13:37
sz0kaninkotech: yep this is what I'm looking forward to do..13:37
prologicproblem with wrapping something like requests13:39
prologicor httplib213:39
prologicis it's hard to make it async13:39
prologicso you have to thread it13:39
prologicor worse monkey patch like gevent13:40
prologicit's best to try and fix the problem13:40
prologiclook to twisted for inspiration13:40
prologicthey've done all the hard work and pain13:40
sz0kawill test if it works with twisted13:41
sz0katwisted is broken, too :)13:48
sz0kait does return nothing :D13:48
sz0kaso no response received13:48
sz0kaso an error occured13:48
sz0kaprologic: okay another idea14:00
sz0kai'll write a client14:00
sz0kawith pycurl14:00
sz0kasupporting request and response events14:00
prologicit won't be async though :)14:09
prologicbut if you want14:09
sz0kapycurl is async14:12
sz0ka(says their documentation)14:12
*** mfdl has joined #circuits14:51
sz0kaokay guys, I'm away15:00
*** AndChat-226100 has joined #circuits15:22
*** sz0ka_ has quit IRC15:24
*** mfdl has quit IRC15:25
*** sz0ka_ has joined #circuits16:00
*** AndChat-226100 has quit IRC16:04
*** sz0ka_ has quit IRC18:03
*** koobs has quit IRC22:08
*** koobs has joined #circuits22:08
prologicmron'n all22:47

Generated by 2.11.0 by Marius Gedminas - find it at!