diff --git a/scripts/e2e/long_session.py b/scripts/e2e/long_session.py index 90a7a184..c47debf2 100644 --- a/scripts/e2e/long_session.py +++ b/scripts/e2e/long_session.py @@ -45,7 +45,7 @@ def take(files, start, chars): parts, used, i = [], 0, start while i < len(files) and used < chars: with open(files[i], encoding="utf-8", errors="replace") as f: - text = f.read() + text = f.read()[: chars - used] # the last file is cut to the budget, so a turn never overshoots by a whole file parts.append("// ==== " + os.path.relpath(files[i], os.path.dirname(files[0])).replace("\\", "/") + "\n" + text) used += len(text) i += 1