We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6202787 commit fc4df51Copy full SHA for fc4df51
importlib_metadata/__init__.py
@@ -315,12 +315,10 @@ class PackagePath(pathlib.PurePosixPath):
315
dist: "Distribution"
316
317
def read_text(self, encoding: str = 'utf-8') -> str: # type: ignore[override]
318
- with self.locate().open(encoding=encoding) as stream:
319
- return stream.read()
+ return self.locate().read_text(encoding=encoding)
320
321
def read_binary(self) -> bytes:
322
- with self.locate().open('rb') as stream:
323
+ return self.locate().read_bytes()
324
325
def locate(self) -> pathlib.Path:
326
"""Return a path-like object for this path"""
0 commit comments