Skip to content

Commit

Permalink
Merge pull request #2538 from pypa/bugfix/1390-lenient-description
Browse files Browse the repository at this point in the history
Repair Descriptions with newlines and emit a warning
  • Loading branch information
jaraco committed Jan 17, 2021
2 parents 6b44f94 + 2f891b4 commit cda7414
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/1390.misc.rst
Original file line number Diff line number Diff line change
@@ -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).
4 changes: 3 additions & 1 deletion setuptools/dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit cda7414

Please sign in to comment.