pip icon indicating copy to clipboard operation
pip copied to clipboard

Use strict optional checking in misc.py

Open hauntsaninja opened this issue 2 years ago • 0 comments

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 avatar Aug 16 '22 00:08 hauntsaninja