But it would print "HERE" so many times, wouldn't it?
On Sun, Feb 12, 2012 at 5:36 AM, Graham Dumpleton < [email protected]> wrote: > So if an exception occurs that isn't derived from Exception class then > it will go into an infinite loop. > > Add an 'except:' branch to try after that for Exception. > > Graham > > On 12 February 2012 17:04, Phyllipe Medeiros <[email protected]> > wrote: > > I have something like that: > > while True: > > ...try: > > ........print "HERE" > > ........response, content = self.http.request('http://www.spoj.pl/', > 'POST', > > headers=self.headers, body=urlencode(self.bodyLogin)) > > ........print "AFTER" > > ........break; > > ....except Exception as detail: > > .......print "ERROR" > > If I execute this without creating a thread, I got: "HERE" and "AFTER" > > If I execute this using a thread, I got only: "HERE" > > These are my headers and bodyLogin: > > self.headers = { > > 'Content-type': 'application/x-www-form-urlencoded', > > 'Accept': 'text/plain' > > } > > self.bodyLogin = { > > 'login_user':self.judge_login, > > 'password':self.judge_passwd, > > 'autologin':'1', > > } > > > > On Sat, Feb 11, 2012 at 6:19 PM, Graham Dumpleton > > <[email protected]> wrote: > >> > >> What are you making the HTTP request to? How do you know it is going > >> into an infinite loop and what specifically is going into an infinite > >> loop? > >> > >> Some more detail would be helpful in understanding the issue. > >> > >> Graham > >> > >> On 12 February 2012 06:08, Phyllipe <[email protected]> wrote: > >> > Hi everyone, > >> > I have a django application that works pretty fine with django web- > >> > server. > >> > I have a python file that uses Http() from httplib2, it works very > >> > well! But when I create a thread and in this thread use this python > >> > file(more precisely a class) that uses Http() it seems that I got in a > >> > infinite loop. > >> > I am very noob in this kind of problems, but I think the problem is in > >> > Apache or mod_wsgi because if I use django webserver it works as well! > >> > But if I use Apache2 + mod_wsgi it doesn't work! Other strange thing > >> > is that in my house it works ;/, it doesn't work at my server ;(. > >> > If I use this class(that calls Http() ) without a thread involving it, > >> > it works fine too ;/. > >> > This my configuration Apache/2.2.14 (Ubuntu) DAV/2 SVN/1.6.6 PHP/ > >> > 5.3.2-1ubuntu4.10 with Suhosin-Patch mod_wsgi/3.3 Python/2.7 > >> > configured -- resuming normal operations > >> > I have tested with other python version too. > >> > My httpd.conf: > >> > ### > >> > LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so > >> > WSGIScriptAlias / /srv/www/ufcgjudge/apache/django.wsgi > >> > ######## > >> > At sites-available/ufcgjudge: > >> > """ > >> > WSGIDaemonProcess ufcgjudge processes=2 threads=15 display-name=% > >> > {GROUP} > >> > WSGIProcessGroup ufcgjudge > >> > > >> > WSGIScriptAlias / /srv/www/ufcgjudge/apache/django.wsgi > >> > """ > >> > Exactly the same way that is in my house.(And works here!) > >> > > >> > -- > >> > You received this message because you are subscribed to the Google > >> > Groups "modwsgi" group. > >> > To post to this group, send email to [email protected]. > >> > To unsubscribe from this group, send email to > >> > [email protected]. > >> > For more options, visit this group at > >> > http://groups.google.com/group/modwsgi?hl=en. > >> > > >> > >> -- > >> You received this message because you are subscribed to the Google > Groups > >> "modwsgi" group. > >> To post to this group, send email to [email protected]. > >> To unsubscribe from this group, send email to > >> [email protected]. > >> For more options, visit this group at > >> http://groups.google.com/group/modwsgi?hl=en. > >> > > > > -- > > You received this message because you are subscribed to the Google Groups > > "modwsgi" group. > > To post to this group, send email to [email protected]. > > To unsubscribe from this group, send email to > > [email protected]. > > For more options, visit this group at > > http://groups.google.com/group/modwsgi?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "modwsgi" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/modwsgi?hl=en. > > -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en.
