From 2f891b433c42eb1554644199058c9190790ebf85 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 17 Jan 2021 12:14:25 -0500 Subject: [PATCH] Repair Descriptions with newlines and emit a warning that the value will be disallowed in the future. --- changelog.d/1390.misc.rst | 1 + setuptools/dist.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelog.d/1390.misc.rst diff --git a/changelog.d/1390.misc.rst b/changelog.d/1390.misc.rst new file mode 100644 index 0000000000..5e4fb11488 --- /dev/null +++ b/changelog.d/1390.misc.rst @@ -0,0 +1 @@ +Validation of Description field now is more lenient, emitting a warning and mangling the value to be valid (replacing newlines with spaces). diff --git a/setuptools/dist.py b/setuptools/dist.py index 2d0aac333d..172d66b1f4 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -121,7 +121,9 @@ def _read_list(name): def single_line(val): # quick and dirty validation for description pypa/setuptools#1390 if '\n' in val: - raise ValueError("newlines not allowed") + # TODO after 2021-07-31: Replace with `raise ValueError("newlines not allowed")` + warnings.UserWarning("newlines not allowed and will break in the future") + val = val.replace('\n', ' ') return val