Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

url_prefix option gives ERROR with _default app #894

Open
nicozanf opened this issue Jul 16, 2024 · 1 comment
Open

url_prefix option gives ERROR with _default app #894

nicozanf opened this issue Jul 16, 2024 · 1 comment
Assignees

Comments

@nicozanf
Copy link
Collaborator

It gives "IndexError: string index out of range". It occurs on the _default app only.

With the command:

./py4web.py run apps -U /dev

[....]

[ ] loading _default ...
[2024-07-16T22:50:52.658092]: Traceback (most recent call last):
File "/home/nico/py4web/py4web/core.py", line 1430, in import_app
module = load_module(module_name, init)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/nico/py4web/py4web/core.py", line 157, in load_module
spec.loader.exec_module(module)
File "", line 995, in exec_module
File "", line 488, in _call_with_frames_removed
File "/home/nico/py4web/apps/_default/init.py", line 5, in
@action("index")
^^^^^^^^^^^^^^^
File "/home/nico/py4web/py4web/core.py", line 1082, in call
Reloader.register_route(app_name, short_path, self.kwargs, func)
File "/home/nico/py4web/py4web/core.py", line 1485, in register_route
bottle.route(rule, **kwargs)(dec_func)
File "/home/nico/py4web/venv/lib/python3.12/site-packages/ombott/ombott.py", line 138, in decorator
self.add_route(rule, method, callback, name, overwrite=overwrite)
File "/home/nico/py4web/venv/lib/python3.12/site-packages/ombott/ombott.py", line 130, in add_route
return self.router.add(rule, method, handler, name, overwrite=overwrite)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/nico/py4web/venv/lib/python3.12/site-packages/ombott/router/radirouter.py", line 240, in add
return self._add(rule, methods, handler, name, meta=meta, overwrite=overwrite)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/nico/py4web/venv/lib/python3.12/site-packages/ombott/router/radirouter.py", line 375, in _add
route = Route(rule)
^^^^^^^^^^^
File "/home/nico/py4web/venv/lib/python3.12/site-packages/ombott/router/radirouter.py", line 55, in init
pattern, params, filters, pattern_out, filters_out = self.class.parse_rule(rule)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/nico/py4web/venv/lib/python3.12/site-packages/ombott/router/radirouter.py", line 177, in parse_rule
assert rule[0] == '/'
~~~~^^^
IndexError: string index out of range
[FAILED] loading _default (string index out of range)
[X] loaded _documentation
Dashboard is at: http://127.0.0.1:8000/_dashboard
Ombott v2.0 server starting up (using <class 'py4web.server_adapters.rocketServer..RocketServer'>(reloader=False, logging_level=30))...
Listening on http://127.0.0.1:8000/
Hit Ctrl-C to quit.

@nicozanf
Copy link
Collaborator Author

Strangely, using --url-prefix=/dev gives exactly the same error, while -U=/dev gives a lot more errors (with click module, also) and py4web does not even start

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants