From e2a4627dd2830969d70dd569b4ac7242529a3233 Mon Sep 17 00:00:00 2001 From: Peter Van Dyken Date: Fri, 15 Sep 2023 14:28:26 -0400 Subject: [PATCH] Fix newline encoding issue in zip_list print Certain obscure newline characters were being printed literally, leading to unexpected newlines in the formatted output (affecting zip_lists, Components, and Datasets). Fix by specifically re-encoding those characters --- snakebids/io/printing.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/snakebids/io/printing.py b/snakebids/io/printing.py index 90dd2990..b7f719ad 100644 --- a/snakebids/io/printing.py +++ b/snakebids/io/printing.py @@ -12,7 +12,12 @@ def quote_wrap(val: str) -> str: - return json.dumps(val, ensure_ascii=False) + return ( + json.dumps(val, ensure_ascii=False) + .replace("\x85", "\\x85") + .replace("\u2028", "\\u2028") + .replace("\u2029", "\\u2029") + ) def format_zip_lists(