From 10f955731510afef016e947e6086d60fbe874811 Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Mon, 16 Dec 2024 14:48:58 +0300 Subject: [PATCH] Remove keywords: WIP --- robotframework_reportportal/helpers.py | 2 +- robotframework_reportportal/listener.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/robotframework_reportportal/helpers.py b/robotframework_reportportal/helpers.py index 51c9174..695348b 100644 --- a/robotframework_reportportal/helpers.py +++ b/robotframework_reportportal/helpers.py @@ -72,7 +72,7 @@ def match_pattern(pattern: Optional[re.Pattern], line: Optional[str]) -> bool: return pattern.fullmatch(line) is not None -def unescape(binary_string: str, stop_at: int = -1): +def _unescape(binary_string: str, stop_at: int = -1): result = bytearray() join_list = list() join_idx = -3 diff --git a/robotframework_reportportal/listener.py b/robotframework_reportportal/listener.py index 6af8487..83a7085 100644 --- a/robotframework_reportportal/listener.py +++ b/robotframework_reportportal/listener.py @@ -26,7 +26,7 @@ from reportportal_client.helpers import LifoQueue, is_binary, guess_content_type_from_bytes -from robotframework_reportportal.helpers import translate_glob_to_regex, match_pattern, unescape +from robotframework_reportportal.helpers import translate_glob_to_regex, match_pattern, _unescape from robotframework_reportportal.model import Keyword, Launch, Test, LogMessage, Suite from robotframework_reportportal.service import RobotService from robotframework_reportportal.static import MAIN_SUITE_ID, PABOT_WITHOUT_LAUNCH_ID_MSG @@ -138,7 +138,7 @@ def _build_msg_struct(self, message: Dict[str, Any]) -> LogMessage: + str(msg_content.encode('utf-8'))[:-5] + TRUNCATION_SIGN) else: # Do not log full binary data, since it's usually corrupted - content_type = guess_content_type_from_bytes(unescape(message_str, 128)) + content_type = guess_content_type_from_bytes(_unescape(message_str, 128)) msg.message = (f'Binary data of type "{content_type}" logging skipped, as it was processed as text and' ' hence corrupted.') msg.level = 'WARN'