Skip to content

Commit 6cbec33

Browse files
Accept supported xlrd path inputs
1 parent bbcb3e0 commit 6cbec33

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

‎stubs/xlrd/xlrd/__init__.pyi‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import sys
2-
from _typeshed import SupportsWrite
2+
from _typeshed import StrOrBytesPath, StrPath, SupportsWrite
33
from typing import Final
44

55
from . import timemachine as timemachine
@@ -24,9 +24,9 @@ FILE_FORMAT_DESCRIPTIONS: Final[dict[str, str]]
2424
ZIP_SIGNATURE: Final[bytes]
2525
PEEK_SIZE: Final[int]
2626

27-
def inspect_format(path: str | None = None, content: bytes | None = None) -> str | None: ...
27+
def inspect_format(path: StrPath | None = None, content: bytes | None = None) -> str | None: ...
2828
def open_workbook(
29-
filename: str | None = None,
29+
filename: StrOrBytesPath | None = None,
3030
logfile: SupportsWrite[str] = sys.stdout,
3131
verbosity: int = 0,
3232
use_mmap: bool = True,
@@ -37,5 +37,5 @@ def open_workbook(
3737
ragged_rows: bool = False,
3838
ignore_workbook_corruption: bool = False,
3939
) -> Book: ...
40-
def dump(filename: str, outfile: SupportsWrite[str] = sys.stdout, unnumbered: bool = False) -> None: ...
41-
def count_records(filename: str, outfile: SupportsWrite[str] = sys.stdout) -> None: ...
40+
def dump(filename: StrOrBytesPath, outfile: SupportsWrite[str] = sys.stdout, unnumbered: bool = False) -> None: ...
41+
def count_records(filename: StrOrBytesPath, outfile: SupportsWrite[str] = sys.stdout) -> None: ...

‎stubs/xlrd/xlrd/book.pyi‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import sys
2-
from _typeshed import SupportsWrite
2+
from _typeshed import StrOrBytesPath, SupportsWrite
33
from collections.abc import Iterator
44
from types import TracebackType
55
from typing import Final, Literal
@@ -23,7 +23,7 @@ builtin_name_from_code: Final[dict[str, str]]
2323
code_from_builtin_name: Final[dict[str, str]]
2424

2525
def open_workbook_xls(
26-
filename: str | None = None,
26+
filename: StrOrBytesPath | None = None,
2727
logfile: SupportsWrite[str] = sys.stdout,
2828
verbosity: int = 0,
2929
use_mmap: bool = True,
@@ -104,7 +104,7 @@ class Book(BaseObject):
104104
base: int
105105
def biff2_8_load(
106106
self,
107-
filename: str | None = None,
107+
filename: StrOrBytesPath | None = None,
108108
file_contents: bytes | None = None,
109109
logfile: SupportsWrite[str] = sys.stdout,
110110
verbosity: int = 0,

0 commit comments

Comments
 (0)