Traceback (most recent call last):
File "/usr/bin/gcovr", line 33, in <module>
sys.exit(load_entry_point('gcovr==5.0', 'console_scripts', 'gcovr')())
File "/usr/lib/python3/dist-packages/gcovr/__main__.py", line 280, in main
error_occurred = print_reports(covdata, options, logger)
File "/usr/lib/python3/dist-packages/gcovr/__main__.py", line 432, in print_reports
if generator(covdata, output.abspath, options):
File "/usr/lib/python3/dist-packages/gcovr/writer/html.py", line 281, in print_html_report
css_data = CssRenderer.render(options)
File "/usr/lib/python3/dist-packages/gcovr/writer/html.py", line 121, in render
template = templates().get_template('style.css')
File "/usr/lib/python3/dist-packages/gcovr/writer/html.py", line 44, in __call__
return self.get(*args)
File "/usr/lib/python3/dist-packages/gcovr/writer/html.py", line 33, in load
result = fn(*args)
File "/usr/lib/python3/dist-packages/gcovr/writer/html.py", line 52, in templates
from jinja2 import Environment, PackageLoader
File "/root/.local/lib/python3.10/site-packages/jinja2/__init__.py", line 33, in <module>
from jinja2.environment import Environment, Template
File "/root/.local/lib/python3.10/site-packages/jinja2/environment.py", line 16, in <module>
from jinja2.defaults import BLOCK_START_STRING, \
File "/root/.local/lib/python3.10/site-packages/jinja2/defaults.py", line 32, in <module>
from jinja2.tests import TESTS as DEFAULT_TESTS
File "/root/.local/lib/python3.10/site-packages/jinja2/tests.py", line 13, in <module>
from collections import Mapping
ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib/python3.10/collections/__init__.py)
We cannot upgrade to jinja 3.x since gcovr would then give this error:
Traceback (most recent call last):
File "/usr/bin/gcovr", line 33, in <module>
sys.exit(load_entry_point('gcovr==5.0', 'console_scripts', 'gcovr')())
File "/usr/lib/python3/dist-packages/gcovr/__main__.py", line 280, in main
error_occurred = print_reports(covdata, options, logger)
File "/usr/lib/python3/dist-packages/gcovr/__main__.py", line 432, in print_reports
if generator(covdata, output.abspath, options):
File "/usr/lib/python3/dist-packages/gcovr/writer/html.py", line 401, in print_html_report
lines = formatter.highlighter_for_file(data['filename'])(source_file.read())
File "/usr/lib/python3/dist-packages/gcovr/writer/html.py", line 159, in highlighter_for_file
from jinja2 import Markup
ImportError: cannot import name 'Markup' from 'jinja2' (/root/.local/lib/python3.10/site-packages/jinja2/__init__.py)