]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Add missed `stream` argument (#111775)
authorAlexander Shadchin <shadchin@yandex-team.com>
Tue, 20 Feb 2024 14:09:46 +0000 (17:09 +0300)
committerGitHub <noreply@github.com>
Tue, 20 Feb 2024 14:09:46 +0000 (14:09 +0000)
* Add missed `stream` argument

* Add news

Lib/importlib/resources/simple.py
Misc/NEWS.d/next/Library/2023-11-07-10-22-06.gh-issue-111775.IoVxfX.rst [new file with mode: 0644]

index 7770c922c84fabe0031333a4de305dd6d6852911..96f117fec62c102b442c958181a4efc5688e053c 100644 (file)
@@ -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 (file)
index 0000000..2a3bdd6
--- /dev/null
@@ -0,0 +1,2 @@
+Fix :meth:`importlib.resources.simple.ResourceHandle.open` for text mode,
+added missed ``stream`` argument.