summaryrefslogtreecommitdiff
path: root/pylint/reporters
diff options
context:
space:
mode:
authorSmixi <sismixx@hotmail.fr>2022-10-31 14:35:47 +0100
committerGitHub <noreply@github.com>2022-10-31 14:35:47 +0100
commit35ce253048ce58e20601c4ad7e96fde8a10d1c2f (patch)
treefcd292c8536612080f7d8eb333a4473d9a48d5b4 /pylint/reporters
parenta38c6098304b306c2dd95d544c4da6370b767657 (diff)
downloadpylint-git-35ce253048ce58e20601c4ad7e96fde8a10d1c2f.tar.gz
Fix: reporters receive copy of message (#7620)
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
Diffstat (limited to 'pylint/reporters')
-rw-r--r--pylint/reporters/multi_reporter.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/pylint/reporters/multi_reporter.py b/pylint/reporters/multi_reporter.py
index 45d357445..8bf0828c4 100644
--- a/pylint/reporters/multi_reporter.py
+++ b/pylint/reporters/multi_reporter.py
@@ -6,6 +6,7 @@ from __future__ import annotations
import os
from collections.abc import Callable
+from copy import copy
from typing import TYPE_CHECKING, TextIO
from pylint.message import Message
@@ -77,7 +78,8 @@ class MultiReporter:
def handle_message(self, msg: Message) -> None:
"""Handle a new message triggered on the current file."""
for rep in self._sub_reporters:
- rep.handle_message(msg)
+ # We provide a copy so reporters can't modify message for others.
+ rep.handle_message(copy(msg))
def writeln(self, string: str = "") -> None:
"""Write a line in the output buffer."""