Skip to content

Update urllib3.exceptions stubs - #6865

Merged
srittau merged 10 commits into
python:masterfrom
jpy-git:urllib3.exceptions
Jan 9, 2022
Merged

srittau merged 10 commits into
python:masterfrom
jpy-git:urllib3.exceptions

Conversation

@jpy-git

@jpy-git jpy-git commented Jan 8, 2022

Copy link
Copy Markdown
Contributor

Complete implementation of urllib3.exceptions for latest release (1.26.8): https://github.com/urllib3/urllib3/blob/b1f60e44d43b13e5272d5b6003f125af9c25c8ad/src/urllib3/exceptions.py

Originally I did this in #6794 to update requests.packages.urllib3.exceptions but we're moving this to the urllib3 stubs to remove duplicate work.

(Originally this would have closed #6054 which requested the requests.packages.urllib3.exceptions but I think due the odd way they're importing urllib3 in requests I don't think this PR will close that issue)

@srittau srittau left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks! A few notes below. Also, we should remove the __reduce__ methods. They are inherited from object anyway. Same goes for __repr__.

Comment thread stubs/urllib3/urllib3/exceptions.pyi
Comment thread stubs/urllib3/urllib3/exceptions.pyi
Comment thread stubs/urllib3/urllib3/exceptions.pyi Outdated
Comment thread stubs/urllib3/urllib3/exceptions.pyi
Comment thread stubs/urllib3/urllib3/exceptions.pyi

@AlexWaygood AlexWaygood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We can just remove the __reduce__ and __repr__ methods from the stub, since the signatures are the same for object.__reduce__ and object.__repr__, and all classes implicitly inherit from object 🙂

Comment thread stubs/urllib3/urllib3/exceptions.pyi Outdated
Comment thread stubs/urllib3/urllib3/exceptions.pyi Outdated
Comment thread stubs/urllib3/urllib3/exceptions.pyi Outdated
Comment thread stubs/urllib3/urllib3/exceptions.pyi Outdated
@srittau
srittau merged commit f68047e into python:master Jan 9, 2022
@jpy-git
jpy-git deleted the urllib3.exceptions branch January 9, 2022 20:57
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.

requests.packages.urllib3.exceptions stubs are incomplete (e.g. SNIMissingWarning is missing)

3 participants