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

Use strict optional checking in misc.py #11382

Merged
merged 6 commits into from
Jul 17, 2023

Conversation

hauntsaninja
Copy link
Contributor

Two things to change here:

First, I think the StreamWrapper code was buggy and it meant to patch an
instance, not the class. It probably doesn't show up in practice because
the encodings are the same.

Second, urlparse's hostname can be None. While this isn't likely, I
chose to put it in the signature rather than assert. I then need one
assert when something from it gets added to self.pip_trusted_origins
in another file. self.pip_trusted_origins genuinely assumes that
hostname is not None, so the assert seemed fine.

Two things to change here:

First, I think the StreamWrapper code was buggy and it meant to patch an
instance, not the class. It probably doesn't show up in practice because
the encodings are the same.

Second, urlparse's hostname can be None. While this isn't likely, I
chose to put it in the signature rather than assert. I then need one
assert when something from it gets added to `self.pip_trusted_origins`
in another file. `self.pip_trusted_origins` genuinely assumes that
hostname is not None, so the assert seemed fine.
@hauntsaninja
Copy link
Contributor Author

Bump! :-)

@hauntsaninja
Copy link
Contributor Author

test_pip_wheel_ext_module_with_tmpdir_inside is failing on several other PRs, going to assume it's something spurious or broken unless told otherwise!

@pradyunsg pradyunsg merged commit 593b85f into pypa:main Jul 17, 2023
@pradyunsg pradyunsg mentioned this pull request Jul 17, 2023
@hauntsaninja hauntsaninja deleted the strict-optional-misc branch July 18, 2023 06:25
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants