Skip to content

Commit

Permalink
Remove keywords: WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
HardNorth committed Dec 16, 2024
1 parent 5dafae4 commit 10f9557
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion robotframework_reportportal/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions robotframework_reportportal/listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'
Expand Down

0 comments on commit 10f9557

Please sign in to comment.