Skip to content

Commit

Permalink
Merge pull request #2870 from webknjaz/maintenance/fail-loudly-on-inv…
Browse files Browse the repository at this point in the history
…alid-summary

Fail on a multiline distribution package summary
  • Loading branch information
jaraco authored Nov 13, 2021
2 parents f2de347 + 25d1d54 commit 77678ab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions changelog.d/2870.breaking.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Started failing on invalid inline description with line breaks :class:`ValueError` -- by :user:`webknjaz`
8 changes: 4 additions & 4 deletions setuptools/dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,11 @@ def read_pkg_file(self, file):


def single_line(val):
# quick and dirty validation for description pypa/setuptools#1390
"""Validate that the value does not have line breaks."""
# Ref: https://github.com/pypa/setuptools/issues/1390
if '\n' in val:
# TODO after 2021-07-31: Replace with `raise ValueError("newlines not allowed")`
warnings.warn("newlines not allowed and will break in the future")
val = val.replace('\n', ' ')
raise ValueError('Newlines are not allowed')

return val


Expand Down

0 comments on commit 77678ab

Please sign in to comment.