Skip to content

Commit fd4bd16

Browse files
authored
Fix leftover http issues (#54)
1 parent f6e4382 commit fd4bd16

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

googleapiclient-stubs/http.pyi

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import logging
44
import typing
55

66
import httplib2
7-
from _typeshed import Incomplete
7+
from _typeshed import Incomplete, StrPath
88

99
from googleapiclient.errors import (
1010
BatchError as BatchError,
@@ -60,7 +60,7 @@ class MediaIoBaseUpload(MediaUpload):
6060
class MediaFileUpload(MediaIoBaseUpload):
6161
def __init__(
6262
self,
63-
filename: str, # TODO: StrPath?
63+
filename: StrPath,
6464
mimetype: str | None = None,
6565
chunksize: int = 104857600,
6666
resumable: bool = False,
@@ -76,7 +76,9 @@ class MediaInMemoryUpload(MediaIoBaseUpload):
7676
) -> None: ...
7777

7878
class MediaIoBaseDownload:
79-
def __init__(self, fd, request, chunksize: int = 104857600) -> None: ...
79+
def __init__(
80+
self, fd: io.IOBase, request: HttpRequest, chunksize: int = 104857600
81+
) -> None: ...
8082
def next_chunk(
8183
self, num_retries: int = 0
8284
) -> tuple[MediaDownloadProgress, bool]: ...
@@ -85,7 +87,7 @@ class HttpRequest:
8587
uri: str
8688
method: str
8789
body: str | None
88-
headers: dict | None
90+
headers: dict[str, str] | None
8991
methodId: str | None
9092
http: httplib2.Http | HttpMock
9193
postproc: collections.abc.Callable[[httplib2.Response, bytes], typing.Any]
@@ -101,7 +103,7 @@ class HttpRequest:
101103
uri: str,
102104
method: str = "GET",
103105
body: str | None = None,
104-
headers: dict | None = None,
106+
headers: dict[str, str] | None = None,
105107
methodId: str | None = None,
106108
resumable: MediaUpload | None = None,
107109
) -> None: ...

0 commit comments

Comments
 (0)