diff --git a/src/allmydata/storage/http_client.py b/src/allmydata/storage/http_client.py index 9711e748d..9203d02ab 100644 --- a/src/allmydata/storage/http_client.py +++ b/src/allmydata/storage/http_client.py @@ -586,7 +586,7 @@ class StorageClientImmutables(object): ) @inlineCallbacks - def list_shares(self, storage_index): # type: (bytes,) -> Deferred[set[int]] + def list_shares(self, storage_index: bytes) -> Deferred[set[int]]: """ Return the set of shares for a given storage index. """ diff --git a/src/allmydata/storage/http_server.py b/src/allmydata/storage/http_server.py index 46023be72..bcad0e972 100644 --- a/src/allmydata/storage/http_server.py +++ b/src/allmydata/storage/http_server.py @@ -3,7 +3,7 @@ HTTP server for storage. """ from __future__ import annotations -from typing import Dict, List, Set, Tuple, Any, Callable +from typing import Dict, List, Set, Tuple, Any, Callable, Optional from functools import wraps from base64 import b64decode @@ -274,7 +274,7 @@ _SCHEMAS = { } -def read_range(request, read_data: Callable[int, int, bytes]) -> Optional[bytes]: +def read_range(request, read_data: Callable[[int, int], bytes]) -> Optional[bytes]: """ Parse the ``Range`` header, read appropriately, return as result. @@ -298,7 +298,7 @@ def read_range(request, read_data: Callable[int, int, bytes]) -> Optional[bytes] data = read_data(start, start + 65536) if not data: request.finish() - return + return None request.write(data) start += len(data) diff --git a/src/allmydata/test/test_storage_http.py b/src/allmydata/test/test_storage_http.py index 7ed4cd235..5e0b35d88 100644 --- a/src/allmydata/test/test_storage_http.py +++ b/src/allmydata/test/test_storage_http.py @@ -1105,7 +1105,7 @@ class SharedImmutableMutableTestsMixin: general_client: StorageClientGeneral client: Union[StorageClientImmutables, StorageClientMutables] clientFactory: Callable[ - StorageClient, Union[StorageClientImmutables, StorageClientMutables] + [StorageClient], Union[StorageClientImmutables, StorageClientMutables] ] def upload(self, share_number: int, data_length=26) -> Tuple[bytes, bytes, bytes]: