You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Typing: Intersphinx: mypy type errors in inventory loading #12864
Typeshed update python/typeshed#12616 adds a type-hint for the requests.Response.raw attribute, and mypy fails some Intersphinx loading code with that change in place, as encountered during a recent continuous integration job.
How to Reproduce
Clone and checkout a recent commit from sphinx.git (for example, 0438178).
Install mypy==1.11.1.
Install types-requests==2.32.0.20240905.
Run mypy sphinx/ext/intersphinx/_load.py.
Observe the errors below (they should be identical / very similar to those reported by mypy_primer):
$ mypy sphinx/ext/intersphinx/_load.py
sphinx/ext/intersphinx/_load.py: note: In function "_read_from_url":
sphinx/ext/intersphinx/_load.py:383:5: error: Cannot assign to a method [method-assign]
sphinx/ext/intersphinx/_load.py:383:18: error: "Callable[[int | None, bool | None, bool], bytes] | Any" not callable [misc]
sphinx/ext/intersphinx/_load.py:384:12: error: Incompatible return value type (got "HTTPResponse | Any", expected "IO[Any]") [return-value]
Found 3 errors in 1 file (checked 1 source file)
Activity