]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Remove some dead code from gzip and tarfile (#138123)
authormaurycy <5383+maurycy@users.noreply.github.com>
Mon, 25 Aug 2025 13:23:47 +0000 (15:23 +0200)
committerGitHub <noreply@github.com>
Mon, 25 Aug 2025 13:23:47 +0000 (16:23 +0300)
The original_n variable and the writebuf and bufsize attributes were never used.

Lib/gzip.py
Lib/tarfile.py

index 89c4738ec69325bda5e8afdc5eba35a47bef3f5e..8a2faf846bf8941826a064cb83f3b813cdcfe273 100644 (file)
@@ -268,8 +268,6 @@ class GzipFile(_streams.BaseStream):
         self.name = filename
         self.crc = zlib.crc32(b"")
         self.size = 0
-        self.writebuf = []
-        self.bufsize = 0
         self.offset = 0  # Current file offset for seek(), tell(), etc
 
     def tell(self):
index c603ba019ab4819e46007de7e4a759d02772cb03..7aa4a032b63e6bbc01d310a7a5e7d8a1ce04c74e 100644 (file)
@@ -201,7 +201,6 @@ def itn(n, digits=8, format=DEFAULT_FORMAT):
     # base-256 representation. This allows values up to (256**(digits-1))-1.
     # A 0o200 byte indicates a positive number, a 0o377 byte a negative
     # number.
-    original_n = n
     n = int(n)
     if 0 <= n < 8 ** (digits - 1):
         s = bytes("%0*o" % (digits - 1, n), "ascii") + NUL