-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] multiline keywords
breaks metadata file
#4887
[BUG] multiline keywords
breaks metadata file
#4887
Comments
Hi @frenzymadness thank you very much for the report, would you like to submit a PR implementing the option |
I'll take a look. |
Newlines in `keywords` or `platforms` can break the produced metadata in PKG-INFO or METADATA files. Fixes: pypa#4887
It turned out it's much easier to fix the behavior and it seems to be backward compatible as well. Also, stripping of the empty characters already happens during the processing if the newer specification with the commas is followed so this change should not break anything, fixes the broken behavior, and will annoy nobody. |
Newlines in `keywords` or `platforms` can break the produced metadata in PKG-INFO or METADATA files. Fixes: pypa/setuptools#4887
Newlines in `keywords` or `platforms` can break the produced metadata in PKG-INFO or METADATA files. Fixes: pypa/setuptools#4887
setuptools version
74.1.3 and 76.0.0
Python version
Python 3.13
OS
Fedora Linux
Additional environment information
No response
Description
I recently discovered that if a project has
keywords
specified as a multiline string, theMETADATA
file generated from it is invalid in the sense that the headers/body split happens on the wrong line.Example project: https://foss.heptapod.net/python-libs/passlib/-/blob/branch/stable/setup.py?ref_type=heads#L93
But you can find more like this here: https://grep.app/search?f.lang=Python&q=keywords%3D%22%22%22
Metadata generated with setuptools 74.1.3:
Here, the empty line ends the headers part, and the key/value pair below it are unreachable in a
Message
instance parsed byemail.parser
.Metadata generated with setuptools 76.0.0:
There is no empty line here but the
keyword
header is not properly folded as a multiline header according to RFC 822 and therefore the result is the same - unreachable key/value pairs below it.I know there were several discussions about the formatting of different fields so I'm not sure this is something to fix here or not. The documentation says that
keywords
can be:so multiline string does not seem to be prohibited.
Expected behavior
setuptools could either fail with an error message saying that keywords are improperly formatted or automatically replace all newlines with a space.
How to Reproduce
METADATA
file manually and check available keys.Output
See the above examples.
The text was updated successfully, but these errors were encountered: