pypa/pip · error · HTTPRangeRequestUnsupported
range request is not supported
Error message
range request is not supported
What it means
Error "range request is not supported" thrown in pypa/pip.
Source
Thrown at src/pip/_internal/network/lazy_wheel.py:67
which is supposed to be fed to ZipFile. If such requests are not
supported by the server, raise HTTPRangeRequestUnsupported
during initialization.
"""
def __init__(
self, url: str, session: PipSession, chunk_size: int = CONTENT_CHUNK_SIZE
) -> None:
head = session.head(url, headers=HEADERS)
raise_for_status(head)
assert head.status_code == 200
self._session, self._url, self._chunk_size = session, url, chunk_size
self._length = int(head.headers["Content-Length"])
self._file = NamedTemporaryFile()
self.truncate(self._length)
self._left: list[int] = []
self._right: list[int] = []
if "bytes" not in head.headers.get("Accept-Ranges", "none"):
raise HTTPRangeRequestUnsupported("range request is not supported")
self._check_zip()
@property
def mode(self) -> str:
"""Opening mode, which is always rb."""
return "rb"
@property
def name(self) -> str:
"""Path to the underlying file."""
return self._file.name
def seekable(self) -> bool:
"""Return whether random access is supported, which is True."""
return True
def close(self) -> None:
"""Close the file."""View on GitHub (pinned to d7d0d0a394)
When it happens
Trigger: Thrown at src/pip/_internal/network/lazy_wheel.py:67 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of pypa/pip@d7d0d0a394 (2026-08-04).
Data as JSON: /data/errors/7b0b04214e2b65bf.json.
Report an issue: GitHub.