Skip to content

Commit 58ad5aa

Browse files
Fix incorrect keyword-only arguments in tarfile.open()
1 parent 39cfcde commit 58ad5aa

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

stdlib/tarfile.pyi

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ class TarFile:
188188
@classmethod
189189
def open(
190190
cls,
191-
name: StrOrBytesPath | None,
192-
mode: Literal["x", "x:", "a", "a:", "w", "w:", "w:tar"],
191+
name: StrOrBytesPath | None = None,
192+
mode: Literal["x", "x:", "a", "a:", "w", "w:", "w:tar"] = ...,
193193
fileobj: _Fileobj | None = None,
194194
bufsize: int = 10240,
195195
*,
@@ -208,10 +208,10 @@ class TarFile:
208208
def open(
209209
cls,
210210
name: StrOrBytesPath | None = None,
211-
*,
212-
mode: Literal["x", "x:", "a", "a:", "w", "w:", "w:tar"],
211+
mode: Literal["x", "x:", "a", "a:", "w", "w:", "w:tar"] = ...,
213212
fileobj: _Fileobj | None = None,
214213
bufsize: int = 10240,
214+
*,
215215
format: int | None = ...,
216216
tarinfo: type[TarInfo] | None = ...,
217217
dereference: bool | None = ...,
@@ -226,8 +226,8 @@ class TarFile:
226226
@classmethod
227227
def open(
228228
cls,
229-
name: StrOrBytesPath | None,
230-
mode: Literal["x:gz", "x:bz2", "w:gz", "w:bz2"],
229+
name: StrOrBytesPath | None = None,
230+
mode: Literal["x:gz", "x:bz2", "w:gz", "w:bz2"] = ...,
231231
fileobj: _Fileobj | None = None,
232232
bufsize: int = 10240,
233233
*,
@@ -247,10 +247,10 @@ class TarFile:
247247
def open(
248248
cls,
249249
name: StrOrBytesPath | None = None,
250-
*,
251-
mode: Literal["x:gz", "x:bz2", "w:gz", "w:bz2"],
250+
mode: Literal["x:gz", "x:bz2", "w:gz", "w:bz2"] = ...,
252251
fileobj: _Fileobj | None = None,
253252
bufsize: int = 10240,
253+
*,
254254
format: int | None = ...,
255255
tarinfo: type[TarInfo] | None = ...,
256256
dereference: bool | None = ...,
@@ -266,8 +266,8 @@ class TarFile:
266266
@classmethod
267267
def open(
268268
cls,
269-
name: StrOrBytesPath | None,
270-
mode: Literal["x:xz", "w:xz"],
269+
name: StrOrBytesPath | None = None,
270+
mode: Literal["x:xz", "w:xz"] = ...,
271271
fileobj: _Fileobj | None = None,
272272
bufsize: int = 10240,
273273
*,
@@ -287,10 +287,10 @@ class TarFile:
287287
def open(
288288
cls,
289289
name: StrOrBytesPath | None = None,
290-
*,
291-
mode: Literal["x:xz", "w:xz"],
290+
mode: Literal["x:xz", "w:xz"] = ...,
292291
fileobj: _Fileobj | None = None,
293292
bufsize: int = 10240,
293+
*,
294294
format: int | None = ...,
295295
tarinfo: type[TarInfo] | None = ...,
296296
dereference: bool | None = ...,
@@ -307,10 +307,10 @@ class TarFile:
307307
def open(
308308
cls,
309309
name: StrOrBytesPath | ReadableBuffer | None = None,
310-
*,
311-
mode: Literal["r|*", "r|", "r|gz", "r|bz2", "r|xz"],
310+
mode: Literal["r|*", "r|", "r|gz", "r|bz2", "r|xz"] = ...,
312311
fileobj: _Fileobj | None = None,
313312
bufsize: int = 10240,
313+
*,
314314
format: int | None = ...,
315315
tarinfo: type[TarInfo] | None = ...,
316316
dereference: bool | None = ...,
@@ -326,10 +326,10 @@ class TarFile:
326326
def open(
327327
cls,
328328
name: StrOrBytesPath | WriteableBuffer | None = None,
329-
*,
330-
mode: Literal["w|", "w|xz"],
329+
mode: Literal["w|", "w|xz"] = ...,
331330
fileobj: _Fileobj | None = None,
332331
bufsize: int = 10240,
332+
*,
333333
format: int | None = ...,
334334
tarinfo: type[TarInfo] | None = ...,
335335
dereference: bool | None = ...,
@@ -345,10 +345,10 @@ class TarFile:
345345
def open(
346346
cls,
347347
name: StrOrBytesPath | WriteableBuffer | None = None,
348-
*,
349-
mode: Literal["w|gz", "w|bz2"],
348+
mode: Literal["w|gz", "w|bz2"] = ...,
350349
fileobj: _Fileobj | None = None,
351350
bufsize: int = 10240,
351+
*,
352352
format: int | None = ...,
353353
tarinfo: type[TarInfo] | None = ...,
354354
dereference: bool | None = ...,

0 commit comments

Comments
 (0)