[web2py] Re: Can't understand this error in gluon/rewrite.py

2018-09-06 Thread Lisandro
I've modified gluon/rewrite.py to log functions and controllers: if self.args: try: mylog = open('mylog.txt', 'a') mylog.write('%s %s\n' % (self.functions, self.controllers)) mylog.close() except: pass if self.args[0] in self.functions or self.args[0] in

[web2py] Re: Can't understand this error in gluon/rewrite.py

2018-09-04 Thread Leonel Câmara
The problems seems to be in the controllers and not in the application list since looking at your logs they seem to be fine. Notice that "load" does not check if the controllers are coming just with "DEFAULT" string. https://github.com/web2py/web2py/blob/master/gluon/rewrite.py#L283 Can you lo

[web2py] Re: Can't understand this error in gluon/rewrite.py

2018-09-04 Thread Lisandro
Thank you all for your help. I've tried to log the value of routers.BASE.applications, but I'm facing an weird situation: The traceback shows that the error is at line 1241 of gluon/rewrite.py (the second line): if self.args: if self.args[0] in self.functions or self.args[0] in self.control

[web2py] Re: Can't understand this error in gluon/rewrite.py

2018-09-03 Thread Anthony
On Monday, September 3, 2018 at 1:47:41 PM UTC-4, Leonel Câmara wrote: > > Since it only happens with some installations, my guess is that this is > happening in the case where this is the only web2py app (not even the admin > or welcome is installed). In this case the list of applications is pro

[web2py] Re: Can't understand this error in gluon/rewrite.py

2018-09-03 Thread Leonel Câmara
Since it only happens with some installations, my guess is that this is happening in the case where this is the only web2py app (not even the admin or welcome is installed). In this case the list of applications is probably a single string instead of a list. Are you setting routers.BASE.applic

[web2py] Re: Can't understand this error in gluon/rewrite.py

2018-09-03 Thread Lisandro
This is my routes.py: # -*- coding: utf-8 -*- # creates a dictionary that will map each domain with its own app, # based on the content of a text file called "domains_apps", and also # a list of all the apps installed domains = {} apps = [] _archivo = open('domains_apps', 'r') _lineas = _archivo.

[web2py] Re: Can't understand this error in gluon/rewrite.py

2018-09-03 Thread Anthony
What does your routes.py file look like? On Monday, September 3, 2018 at 10:25:22 AM UTC-4, Lisandro wrote: > > This problem is getting weirder. > > I've found that passing integer numbers as args to URL() helper isn't a > problem for web2py. > I could successfully run some examples using intege

[web2py] Re: Can't understand this error in gluon/rewrite.py

2018-09-03 Thread Lisandro
This problem is getting weirder. I've found that passing integer numbers as args to URL() helper isn't a problem for web2py. I could successfully run some examples using integer and long integers as URL args, and it always works ok. In fact, as I stated before, my application uses URL in that

[web2py] Re: Can't understand this error in gluon/rewrite.py

2018-09-02 Thread Lisandro
Thanks for that fast response. If the cause of the problem is passing "contenido.id" as int, then the error is even more weird, because my app uses URL like that in several situations, for example: URL('contenido', 'editar', args=contenido.id) URL('categoria', 'editar', args=categoria.id) URL('d

[web2py] Re: Can't understand this error in gluon/rewrite.py

2018-09-02 Thread fiubarc
Hello, I think it's more a matter of python language, contenido.id is long type then self.args[0] in 'any string' raise an exception because, as the message says : 'in ' requires string as left operand, not long You can do args=['%s' % contenido.id, or args=[str(contenido.id), Don