Used Path.read_text() in jinja2.get_exception_info().
@@ -99,8 +99,7 @@ def get_exception_info(exception):
if source is None:
exception_file = Path(exception.filename)
if exception_file.exists():
- with open(exception_file, 'r') as fp:
- source = fp.read()
+ source = exception_file.read_text()
if source is not None:
lines = list(enumerate(source.strip().split('\n'), start=1))
during = lines[lineno - 1][1]
