_parse_version_many
does not match PEP 508 or documentation
#803
Labels
_parse_version_many
does not match PEP 508 or documentation
#803
PEP 508 says that a
version_many
looks likeversion_one (wsp* ',' version_one)*
and the documentation comment in_parse_version_many
says that aversion_many
looks like(SPECIFIER (WS? COMMA WS? SPECIFIER)*)?
(essentially the same thing, but optional).However, the implementation of
_parse_version_many
actually parses something likeversion_one (wsp* ',' version_one)* wsp* (',' wsp*)?
or(SPECIFIER (WS? COMMA WS? SPECIFIER)* WS? (COMMA WS?)?)?
. An extra comma, possibly surrounded by whitespace, is accepted.It's probably too late to fix the implementation. Packages like this one contain malformed requirements that are accepted by the implementation but not the documentation. The documentation should probably be changed to reflect reality instead.
produces
It looks like the extra, empty specifier is accidentally removed by
SpecifierSet
when it tries to handle converting an empty string into an empty set.produces
Together, these behaviors cause trailing commas in requirements to be ignored, allowing invalid requirements to be installed by setuptools.
produces
The text was updated successfully, but these errors were encountered: