-
Notifications
You must be signed in to change notification settings - Fork 31
yarl update broke static file urls in templates #478
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
Comments
aiohttp-jinja2 has static(): https://aiohttp-jinja2.readthedocs.io/en/stable/#default-globals So, if you can update to that, that would be perfect. |
Thank you, interesting feature. But using that would require to mess with |
Oh, yes, we can't use that until #71 is done. |
Hacky hack goes brrr. As hacky as I could, but without ANY additional pollution to globals |
With yarl version 1.9.2 static files urls with
url_for(filename="")
as used, for example, here:aiohttp-debugtoolbar/aiohttp_debugtoolbar/tbtools/tbtools.py
Line 210 in 6570cb3
aiohttp-debugtoolbar/aiohttp_debugtoolbar/templates/toolbar.jinja2
Line 10 in 6570cb3
I traced issue to this line in yarl: https://github.com/aio-libs/yarl/blob/1f94e1a7833a27203d63f8618d01d4d4fa2d3520/yarl/_url.py#L719. With segment as empty string - main loop breaks immediately.
Issue is observed with yarl versions 1.9.2 and 1.9.1 and disappears with yarl version 1.8.2.
I can rewrite templates using
url_for
instead of{{ static_path }}css/debugger.css
like syntax and provide a pull request. Is it acceptable fix? Should I do it?The text was updated successfully, but these errors were encountered: