Skip to content

Commit b300b3d

Browse files
committed
gh-137070: Clarify Traversable.open text parameters
1 parent 77dd973 commit b300b3d

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎Doc/library/importlib.resources.abc.rst‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@
157157
*mode* may be 'r' or 'rb' to open as text or binary. Return a handle
158158
suitable for reading (same as :attr:`pathlib.Path.open`).
159159

160-
When opening as text, accepts encoding parameters such as those
161-
accepted by :class:`io.TextIOWrapper`.
160+
When opening as text, accepts the *encoding*, *errors*, and *newline*
161+
keyword arguments with the same meanings as in :class:`io.TextIOWrapper`.
162162

163163
.. method:: read_bytes()
164164

‎Lib/importlib/resources/abc.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ def open(self, mode: str = 'r', *args: Any, **kwargs: Any) -> TextIO | BinaryIO:
154154
mode may be 'r' or 'rb' to open as text or binary. Return a handle
155155
suitable for reading (same as pathlib.Path.open).
156156
157-
When opening as text, accepts encoding parameters such as those
158-
accepted by io.TextIOWrapper.
157+
When opening as text, accepts the encoding, errors, and newline
158+
keyword arguments with the same meanings as in io.TextIOWrapper.
159159
"""
160160

161161
@property

0 commit comments

Comments
 (0)