I can't comment fully on the routes changes, but the errors you are
getting are errors in presenting you with the errors.  the
error_message that you used to have at the bottom of your routes.py:

error_message = '<html><body><h1>Invalid request</h1></body></html>'

needs to be upgraded to have a %s in it somewhere, perhaps like:

error_message = '<html><body><h1>%s</h1></body></html>'

if you fix that then you will get the real error message and can debug
from there.

i don't know if this would be considered a change that breaks
backwards compatibility...

cfh

On Oct 13, 10:44 am, Andrew Thompson <[email protected]> wrote:
>   I'm having a problem with a couple of routes I've been using for a
> month or two:
>
> routes_out = (
>    ('^/(aktzero|app|tobarja)/default/index', '/'),
>    ('^/(aktzero|app|tobarja)/$c/index', '/$c/'),
>    ('^/(aktzero|app|tobarja)/$anything', '/$anything'),
> )
>
> The first one seems fine.
>
> The second one give me errors like this on the console where I started
> web2py:
>
> www-d...@teros:~/web2py$ ERROR:web2py:Traceback (most recent call last):
>    File "/var/www/web2py/gluon/main.py", line 352, in wsgibase
>      response.stream(static_file, request=request)
>    File "/var/www/web2py/gluon/globals.py", line 151, in stream
>      headers=self.headers)
>    File "/var/www/web2py/gluon/streamer.py", line 49, in
> stream_file_or_304_or_206
>      error_message = rewrite.thread.routes.error_message % 'invalid request'
> TypeError: not all arguments converted during string formatting
>
> The third, if I include it, breaks /static/foo and turns the single
> error output into several:
>
> www-d...@teros:~/web2py$ ERROR:web2py:Traceback (most recent call last):
>    File "/var/www/web2py/gluon/main.py", line 352, in wsgibase
>      response.stream(static_file, request=request)
>    File "/var/www/web2py/gluon/globals.py", line 151, in stream
>      headers=self.headers)
>    File "/var/www/web2py/gluon/streamer.py", line 49, in
> stream_file_or_304_or_206
>      error_message = rewrite.thread.routes.error_message % 'invalid request'
> TypeError: not all arguments converted during string formatting
>
> ERROR:web2py:Traceback (most recent call last):
>    File "/var/www/web2py/gluon/main.py", line 352, in wsgibase
>      response.stream(static_file, request=request)
>    File "/var/www/web2py/gluon/globals.py", line 151, in stream
>      headers=self.headers)
>    File "/var/www/web2py/gluon/streamer.py", line 49, in
> stream_file_or_304_or_206
>      error_message = rewrite.thread.routes.error_message % 'invalid request'
> TypeError: not all arguments converted during string formatting
>
> ERROR:web2py:Traceback (most recent call last):
>    File "/var/www/web2py/gluon/main.py", line 352, in wsgibase
>      response.stream(static_file, request=request)
>    File "/var/www/web2py/gluon/globals.py", line 151, in stream
>      headers=self.headers)
>    File "/var/www/web2py/gluon/streamer.py", line 49, in
> stream_file_or_304_or_206
>      error_message = rewrite.thread.routes.error_message % 'invalid request'
> TypeError: not all arguments converted during string formatting
>
> ERROR:web2py:Traceback (most recent call last):
>    File "/var/www/web2py/gluon/main.py", line 352, in wsgibase
>      response.stream(static_file, request=request)
>    File "/var/www/web2py/gluon/globals.py", line 151, in stream
>      headers=self.headers)
>    File "/var/www/web2py/gluon/streamer.py", line 49, in
> stream_file_or_304_or_206
>      error_message = rewrite.thread.routes.error_message % 'invalid request'
> TypeError: not all arguments converted during string formatting
>
> ERROR:web2py:Traceback (most recent call last):
>    File "/var/www/web2py/gluon/main.py", line 352, in wsgibase
>      response.stream(static_file, request=request)
>    File "/var/www/web2py/gluon/globals.py", line 151, in stream
>      headers=self.headers)
>    File "/var/www/web2py/gluon/streamer.py", line 49, in
> stream_file_or_304_or_206
>      error_message = rewrite.thread.routes.error_message % 'invalid request'
> TypeError: not all arguments converted during string formatting
>
> Any ideas? Did the syntax change?
>
> Thanks.
>
> --
> Andrew Thompsonhttp://aktzero.com/

Reply via email to