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

_UrlopenRet gives error that addinfourl has no attribute status #3026

Closed
ThrowsException opened this issue Jun 1, 2019 · 1 comment · Fixed by #3045
Closed

_UrlopenRet gives error that addinfourl has no attribute status #3026

ThrowsException opened this issue Jun 1, 2019 · 1 comment · Fixed by #3045
Labels
stubs: false positive Type checkers report false errors

Comments

@ThrowsException
Copy link

_UrlopenRet is defined _UrlopenRet = Union[_HTTPResponse, addinfourl] but addinfourl has to attribute status so when checking the status of an HTTPResponse you receive error: Item "addinfourl" of "Union[HTTPResponse, addinfourl]" has no attribute "status"

https://github.com/python/cpython/blob/3.7/Lib/urllib/response.py#L68-L80

@srittau
Copy link
Collaborator

srittau commented Jun 5, 2019

_UrlopenRet should probably just be changed to Any, until something like python/typing#566 is implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stubs: false positive Type checkers report false errors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants