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

avoid errors on Template #315

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
avoid errors on Template
  • Loading branch information
phenobarbital committed Nov 12, 2024
commit 4d5087b269f41c6dce6c39d65c074c75657bafeb
9 changes: 8 additions & 1 deletion navigator/template/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,14 @@ def configure(self):
# TODO: check the bug ,encoding='ANSI'
self.env = Environment(loader=self.loader, **self.config)
compiled_path = str(self.tmpl_dir.joinpath(".compiled"))
self.env.compile_templates(target=compiled_path, zip="deflated")
try:
self.env.compile_templates(
target=compiled_path,
zip="deflated",
ignore_errors=True
)
except UnicodeDecodeError:
pass
### adding custom filters:
if self.filters is not None:
self.env.filters.update(self.filters)
Expand Down
2 changes: 1 addition & 1 deletion navigator/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
__description__ = (
"Navigator Web Framework based on aiohttp, " "with batteries included."
)
__version__ = "2.11.4"
__version__ = "2.11.5"
__author__ = "Jesus Lara"
__author_email__ = "jesuslarag@gmail.com"
__license__ = "BSD"
Loading