diff --git a/python-stdlib/tarfile/tarfile/__init__.py b/python-stdlib/tarfile/tarfile/__init__.py index 4bb95af30..b56914106 100644 --- a/python-stdlib/tarfile/tarfile/__init__.py +++ b/python-stdlib/tarfile/tarfile/__init__.py @@ -41,11 +41,13 @@ def read(self, sz=65536): self.content_len -= sz return data - def readinto(self, buf): + def readinto(self, buf, size=None): if self.content_len == 0: return 0 if len(buf) > self.content_len: buf = memoryview(buf)[: self.content_len] + if size is not None and len(buf) > size: + buf = memoryview(buf)[:size] sz = self.f.readinto(buf) self.content_len -= sz return sz pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy