From 17ae908a54e77c383b16393262f7d2c9581d23a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Laurent?= <francois.laurent@posteo.net> Date: Thu, 25 Jul 2024 15:06:26 +0200 Subject: [PATCH] feat: handle escaped newlines --- src/taggingbackends/explorer.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/taggingbackends/explorer.py b/src/taggingbackends/explorer.py index 40644c8..f05f382 100644 --- a/src/taggingbackends/explorer.py +++ b/src/taggingbackends/explorer.py @@ -201,7 +201,8 @@ Cannot find any Python package in project root directory: line = line[len(prefix):] if line.startswith("root:"): line = line[5:] - log(line.lstrip()) + line = '\n'.join(line.lstrip().split(r'\n')) + log(line) return # other Python warning messages from dependencies if line.startswith(" warn(") or line.startswith(" warnings.warn("): @@ -260,13 +261,16 @@ Cannot find any Python package in project root directory: lines = [] for line in msg.splitlines(): lines = self._parse_stdout(logger, lines, line) + if lines: + logger.info("\n".join(lines)) if ret.stderr: msg = ret.stderr.decode("utf-8") lines = [] for line in msg.splitlines(): self._parse_stderr(logger, lines, line) if lines: - raise Exception(f"in {path.name}:\n"+"\n".join(lines)) + msg = f"in {path.name}:\n"+"\n".join(lines) + raise Exception(msg) sys.stderr.flush() sys.stdout.flush() return ret -- GitLab