summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-02-20 16:36:55 (GMT)
committerGitHub <noreply@github.com>2024-02-20 16:36:55 (GMT)
commit20907ca844f6c32a2ecf66f9ea3ab4b8bba93fa5 (patch)
tree26c31416518532ea993fe767bdceff38ae7769c5
parentb7c633fbfc9f365c7e00969c4fd980b63949db8f (diff)
downloadcpython-20907ca844f6c32a2ecf66f9ea3ab4b8bba93fa5.zip
cpython-20907ca844f6c32a2ecf66f9ea3ab4b8bba93fa5.tar.gz
cpython-20907ca844f6c32a2ecf66f9ea3ab4b8bba93fa5.tar.bz2
[3.12] Add missed `stream` argument (GH-111775) (#115716)
Add missed `stream` argument (GH-111775) * Add missed `stream` argument * Add news (cherry picked from commit 1ff6c1416b0bb422f4847cd84fcb33662a2497ef) Co-authored-by: Alexander Shadchin <shadchin@yandex-team.com>
-rw-r--r--Lib/importlib/resources/simple.py2
-rw-r--r--Misc/NEWS.d/next/Library/2023-11-07-10-22-06.gh-issue-111775.IoVxfX.rst2
2 files changed, 3 insertions, 1 deletions
diff --git a/Lib/importlib/resources/simple.py b/Lib/importlib/resources/simple.py
index 7770c92..96f117f 100644
--- a/Lib/importlib/resources/simple.py
+++ b/Lib/importlib/resources/simple.py
@@ -88,7 +88,7 @@ class ResourceHandle(Traversable):
def open(self, mode='r', *args, **kwargs):
stream = self.parent.reader.open_binary(self.name)
if 'b' not in mode:
- stream = io.TextIOWrapper(*args, **kwargs)
+ stream = io.TextIOWrapper(stream, *args, **kwargs)
return stream
def joinpath(self, name):
diff --git a/Misc/NEWS.d/next/Library/2023-11-07-10-22-06.gh-issue-111775.IoVxfX.rst b/Misc/NEWS.d/next/Library/2023-11-07-10-22-06.gh-issue-111775.IoVxfX.rst
new file mode 100644
index 0000000..2a3bdd6
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2023-11-07-10-22-06.gh-issue-111775.IoVxfX.rst
@@ -0,0 +1,2 @@
+Fix :meth:`importlib.resources.simple.ResourceHandle.open` for text mode,
+added missed ``stream`` argument.