| AttributeError | Python 3.9.25: /home/tjlahton/public_html/cgi-bin/ties4080/venv/bin/python Wed Sep 16 07:46:06 2026 |
A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.
| /home/tjlahton/public_html/cgi-bin/python/jinja.cgi in <module> |
| 26 # alustetaan jinjan kaipaama ympäristö ja asetetaan myös autoescape käyttöön eli jinja automaattisesti |
| 27 # korjaa erikoismerkit html:ään kelpaavaan muotoon |
| => 28 env = Environment(autoescape=True, loader=FileSystemLoader(tmpl_path), extensions=['jinja2.ext.autoescape']) |
| 29 |
| 30 # ladataan varsinainen template-tiedosto |
| env undefined, Environment = <class 'jinja2.environment.Environment'>, autoescape undefined, loader undefined, FileSystemLoader = <class 'jinja2.loaders.FileSystemLoader'>, tmpl_path = '/home/tjlahton/public_html/cgi-bin/python/templates', extensions undefined |
| /home/tjlahton/public_html/cgi-bin/ties4080/venv/lib64/python3.9/site-packages/jinja2/environment.py in __init__(self=<jinja2.environment.Environment object>, block_start_string='{%', block_end_string='%}', variable_start_string='{{', variable_end_string='}}', comment_start_string='{#', comment_end_string='#}', line_statement_prefix=None, line_comment_prefix=None, trim_blocks=False, lstrip_blocks=False, newline_sequence='\n', keep_trailing_newline=False, extensions=['jinja2.ext.autoescape'], optimized=True, undefined=<class 'jinja2.runtime.Undefined'>, finalize=None, autoescape=True, loader=<jinja2.loaders.FileSystemLoader object>, cache_size=400, auto_reload=True, bytecode_cache=None, enable_async=False) |
| 363 |
| 364 # load extensions |
| => 365 self.extensions = load_extensions(self, extensions) |
| 366 |
| 367 self.is_async = enable_async |
| self = <jinja2.environment.Environment object>, self.extensions undefined, global load_extensions = <function load_extensions>, extensions = ['jinja2.ext.autoescape'] |
| /home/tjlahton/public_html/cgi-bin/ties4080/venv/lib64/python3.9/site-packages/jinja2/environment.py in load_extensions(environment=<jinja2.environment.Environment object>, extensions=['jinja2.ext.autoescape']) |
| 117 for extension in extensions: |
| 118 if isinstance(extension, str): |
| => 119 extension = t.cast(t.Type["Extension"], import_string(extension)) |
| 120 |
| 121 result[extension.identifier] = extension(environment) |
| extension = 'jinja2.ext.autoescape', global t = <module 'typing' from '/usr/lib64/python3.9/typing.py'>, t.cast = <function cast>, t.Type = typing.Type, global import_string = <function import_string> |
| /home/tjlahton/public_html/cgi-bin/ties4080/venv/lib64/python3.9/site-packages/jinja2/utils.py in import_string(import_name='jinja2.ext.autoescape', silent=False) |
| 147 else: |
| 148 return __import__(import_name) |
| => 149 return getattr(__import__(module, None, None, [obj]), obj) |
| 150 except (ImportError, AttributeError): |
| 151 if not silent: |
| builtin getattr = <built-in function getattr>, builtin __import__ = <built-in function __import__>, module = 'jinja2.ext', obj = 'autoescape' |
AttributeError: module 'jinja2.ext' has no attribute 'autoescape'
args =
("module 'jinja2.ext' has no attribute 'autoescape'",)
with_traceback =
<built-in method with_traceback of AttributeError object>