Skip to content

distutils/setuptools: Don't use wildcards for allowlist entries #9900

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

Merged
merged 1 commit into from
Mar 17, 2023

Conversation

AlexWaygood
Copy link
Member

These entries are causing more functions to be allowlisted than was intended: for example, none of these methods are generated methods, but they're all currently included by the distutils.dist.Distribution.get_.* entry:

def get_command_list(self): ...
def get_command_packages(self): ...
def get_command_class(self, command: str) -> type[Command]: ...

This caused a bit of confusion for me, as I was fiddling around with a stubtest patch, and expected stubtest to emit an error if I deleted this allowlist entry:

distutils.dist.Distribution.get_command_obj # 1 used for True

...But stubtest didn't emit an error, because distutils.dist.Distribution.get_command_obj was still allowlisted, even with that entry deleted, due to these regex entries here.

@AlexWaygood AlexWaygood changed the title distutils: Don't use wildcards for allowlist entries distutils/setuptools: Don't use wildcards for allowlist entries Mar 17, 2023
Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@hauntsaninja hauntsaninja merged commit ca55889 into python:main Mar 17, 2023
@AlexWaygood AlexWaygood deleted the no-regex-allowlist branch March 18, 2023 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants