Skip to content
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

check_specifier() raises an exception when not passed as string #1932

Closed
plannigan opened this issue Dec 3, 2019 · 0 comments · Fixed by #2583
Closed

check_specifier() raises an exception when not passed as string #1932

plannigan opened this issue Dec 3, 2019 · 0 comments · Fixed by #2583

Comments

@plannigan
Copy link
Contributor

dist.check_specifier() is used to validate that the given argument is valid. The documentation and the error message it produces clearly states the value should be a string. However, if the value is something other than a string, DistutilsSetupError is not raised. This is because SpecifierSet class .split() assuming that the value is a string. This causes:

AttributeError: 'lXXX' object has no attribute 'split'

In my case, it happened to be a list containing one valid specifier.

Instead of failing with this error, check_specifier() should raise DistutilsSetupError to clearly indicate that it was given a value of the wrong type.

This is related to #1869 in that it is hitting the same error. But, I'm suggesting the type be properly checked instead of allowing other types.

jaraco added a commit that referenced this issue Feb 28, 2021
…rror

Handle AttributeError by raising DistutilsSetupError in check_specifier. Fixes #1932
This was referenced Mar 8, 2021
This was referenced Mar 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant