Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
d01d3ee2
Commit
d01d3ee2
authored
Dec 06, 2020
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Quick fix for #1390. Now description cannot contain a newline.
parent
b994bc63
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
changelog.d/1390.change.rst
changelog.d/1390.change.rst
+1
-0
setuptools/dist.py
setuptools/dist.py
+8
-1
No files found.
changelog.d/1390.change.rst
0 → 100644
View file @
d01d3ee2
Newlines in metadata description/Summary now trigger a ValueError.
setuptools/dist.py
View file @
d01d3ee2
...
...
@@ -118,6 +118,13 @@ def read_pkg_file(self, file):
self
.
obsoletes
=
None
def
single_line
(
val
):
# quick and dirty validation for description pypa/setuptools#1390
if
'
\
n
'
in
val
:
raise
ValueError
(
"newlines not allowed"
)
return
val
# Based on Python 3.5 version
def
write_pkg_file
(
self
,
file
):
# noqa: C901 # is too complex (14) # FIXME
"""Write the PKG-INFO format data to a file object.
...
...
@@ -130,7 +137,7 @@ def write_pkg_file(self, file): # noqa: C901 # is too complex (14) # FIXME
write_field
(
'Metadata-Version'
,
str
(
version
))
write_field
(
'Name'
,
self
.
get_name
())
write_field
(
'Version'
,
self
.
get_version
())
write_field
(
'Summary'
,
s
elf
.
get_description
(
))
write_field
(
'Summary'
,
s
ingle_line
(
self
.
get_description
()
))
write_field
(
'Home-page'
,
self
.
get_url
())
if
version
<
StrictVersion
(
'1.2'
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment