https://github.com/python/cpython/commit/edf6e6819b04c08ebe774938438aadfb417a42ef
commit: edf6e6819b04c08ebe774938438aadfb417a42ef
branch: main
author: maurycy <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2025-08-25T16:23:47+03:00
summary:

Remove some dead code from gzip and tarfile (#138123)

The original_n variable and the writebuf and bufsize attributes were never used.

files:
M Lib/gzip.py
M Lib/tarfile.py

diff --git a/Lib/gzip.py b/Lib/gzip.py
index 89c4738ec69325..8a2faf846bf894 100644
--- a/Lib/gzip.py
+++ b/Lib/gzip.py
@@ -268,8 +268,6 @@ def _init_write(self, filename):
         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):
diff --git a/Lib/tarfile.py b/Lib/tarfile.py
index c603ba019ab481..7aa4a032b63e6b 100644
--- a/Lib/tarfile.py
+++ b/Lib/tarfile.py
@@ -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

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to