Index: twisted/python/test/test_zipstream.py
===================================================================
--- twisted/python/test/test_zipstream.py	(revision 34724)
+++ twisted/python/test/test_zipstream.py	(working copy)
@@ -2,8 +2,9 @@
 # See LICENSE for details.
 
 """
-Tests for L{twisted.python.zipstream}
+Tests for L{twisted.python.zipstream}.
 """
+
 import sys
 import random
 import zipfile
@@ -11,11 +12,12 @@
 from twisted.python.compat import set
 from twisted.python import zipstream, filepath
 from twisted.python.hashlib import md5
-from twisted.trial import unittest, util
+from twisted.trial import unittest
+
 
 class FileEntryMixin:
     """
-    File entry classes should behave as file-like objects
+    File entry classes should behave as file-like objects.
     """
     def getFileEntry(self, contents):
         """
@@ -31,7 +33,7 @@
 
     def test_isatty(self):
         """
-        zip files should not be ttys, so isatty() should be false
+        zip files should not be ttys, so isatty() should be false.
         """
         self.assertEqual(self.getFileEntry('').isatty(), False)
 
@@ -122,7 +124,7 @@
 
 class DeflatedZipFileEntryTest(FileEntryMixin, unittest.TestCase):
     """
-    DeflatedZipFileEntry should be file-like
+    DeflatedZipFileEntry should be file-like.
     """
     compression = zipfile.ZIP_DEFLATED
 
@@ -130,7 +132,7 @@
 
 class ZipFileEntryTest(FileEntryMixin, unittest.TestCase):
    """
-   ZipFileEntry should be file-like
+   ZipFileEntry should be file-like.
    """
    compression = zipfile.ZIP_STORED
 
@@ -138,7 +140,7 @@
 
 class ZipstreamTest(unittest.TestCase):
     """
-    Tests for twisted.python.zipstream
+    Tests for twisted.python.zipstream.
     """
     def setUp(self):
         """
@@ -167,19 +169,6 @@
         return zpfilename
 
 
-    def test_countEntries(self):
-        """
-        Make sure the deprecated L{countZipFileEntries} returns the correct
-        number of entries for a zip file.
-        """
-        name = self.makeZipFile(["one", "two", "three", "four", "five"])
-        result = self.assertWarns(DeprecationWarning,
-                                  "countZipFileEntries is deprecated.",
-                                  __file__, lambda :
-                                      zipstream.countZipFileEntries(name))
-        self.assertEqual(result, 5)
-
-
     def test_invalidMode(self):
         """
         A ChunkingZipFile opened in write-mode should not allow .readfile(),
@@ -283,49 +272,6 @@
         self.assertEqual(czf.readfile("0").read(), "the real data")
 
 
-    def test_unzipIter(self):
-        """
-        L{twisted.python.zipstream.unzipIter} should unzip a file for each
-        iteration and yield the number of files left to unzip after that
-        iteration
-        """
-        numfiles = 10
-        contents = ['This is test file %d!' % i for i in range(numfiles)]
-        zpfilename = self.makeZipFile(contents)
-        uziter = zipstream.unzipIter(zpfilename, self.unzipdir.path)
-        for i in range(numfiles):
-            self.assertEqual(len(list(self.unzipdir.children())), i)
-            self.assertEqual(uziter.next(), numfiles - i - 1)
-        self.assertEqual(len(list(self.unzipdir.children())), numfiles)
-
-        for child in self.unzipdir.children():
-            num = int(child.basename())
-            self.assertEqual(child.open().read(), contents[num])
-    test_unzipIter.suppress = [
-        util.suppress(message="zipstream.unzipIter is deprecated")]
-
-
-    def test_unzipIterDeprecated(self):
-        """
-        Use of C{twisted.python.zipstream.unzipIter} will emit a
-        deprecated warning.
-        """
-        zpfilename = self.makeZipFile('foo')
-
-        self.assertEqual(len(self.flushWarnings()), 0)
-
-        for f in zipstream.unzipIter(zpfilename, self.unzipdir.path):
-            pass
-
-        warnings = self.flushWarnings()
-        self.assertEqual(len(warnings), 1)
-        self.assertEqual(warnings[0]['category'], DeprecationWarning)
-        self.assertEqual(
-            warnings[0]['message'],
-            "zipstream.unzipIter is deprecated since Twisted 11.0.0 for "
-            "security reasons.  Use Python's zipfile instead.")
-
-
     def test_unzipIterChunky(self):
         """
         L{twisted.python.zipstream.unzipIterChunky} returns an iterator which
@@ -363,89 +309,6 @@
             self.assertEqual(child.getContent(), contents[num])
 
 
-    def test_unzip(self):
-        """
-        L{twisted.python.zipstream.unzip} should extract all files from a zip
-        archive
-        """
-        numfiles = 3
-        zpfilename = self.makeZipFile([str(i) for i in range(numfiles)])
-        zipstream.unzip(zpfilename, self.unzipdir.path)
-        self.assertEqual(
-            set(self.unzipdir.listdir()),
-            set(map(str, range(numfiles))))
-        for i in range(numfiles):
-            self.assertEqual(self.unzipdir.child(str(i)).getContent(), str(i))
-    test_unzip.suppress = [
-        util.suppress(message="zipstream.unzip is deprecated")]
-
-
-    def test_unzipDeprecated(self):
-        """
-        Use of C{twisted.python.zipstream.unzip} will emit a deprecated warning.
-        """
-        zpfilename = self.makeZipFile('foo')
-
-        self.assertEqual(len(self.flushWarnings()), 0)
-
-        zipstream.unzip(zpfilename, self.unzipdir.path)
-
-        warnings = self.flushWarnings()
-        self.assertEqual(len(warnings), 1)
-        self.assertEqual(warnings[0]['category'], DeprecationWarning)
-        self.assertEqual(
-            warnings[0]['message'],
-            "zipstream.unzip is deprecated since Twisted 11.0.0 for "
-            "security reasons.  Use Python's zipfile instead.")
-
-
-    def test_unzipDirectory(self):
-        """
-        The path to which a file is extracted by L{zipstream.unzip} is
-        determined by joining the C{directory} argument to C{unzip} with the
-        path within the archive of the file being extracted.
-        """
-        numfiles = 3
-        zpfilename = self.makeZipFile([str(i) for i in range(numfiles)], 'foo')
-        zipstream.unzip(zpfilename, self.unzipdir.path)
-        self.assertEqual(
-            set(self.unzipdir.child('foo').listdir()),
-            set(map(str, range(numfiles))))
-        for i in range(numfiles):
-            self.assertEqual(
-                self.unzipdir.child('foo').child(str(i)).getContent(), str(i))
-    test_unzipDirectory.suppress = [
-        util.suppress(message="zipstream.unzip is deprecated")]
-
-
-    def test_overwrite(self):
-        """
-        L{twisted.python.zipstream.unzip} and
-        L{twisted.python.zipstream.unzipIter} shouldn't overwrite files unless
-        the 'overwrite' flag is passed
-        """
-        testfile = self.unzipdir.child('0')
-        zpfilename = self.makeZipFile(['OVERWRITTEN'])
-
-        testfile.setContent('NOT OVERWRITTEN')
-        zipstream.unzip(zpfilename, self.unzipdir.path)
-        self.assertEqual(testfile.open().read(), 'NOT OVERWRITTEN')
-        zipstream.unzip(zpfilename, self.unzipdir.path, overwrite=True)
-        self.assertEqual(testfile.open().read(), 'OVERWRITTEN')
-
-        testfile.setContent('NOT OVERWRITTEN')
-        uziter = zipstream.unzipIter(zpfilename, self.unzipdir.path)
-        uziter.next()
-        self.assertEqual(testfile.open().read(), 'NOT OVERWRITTEN')
-        uziter = zipstream.unzipIter(zpfilename, self.unzipdir.path,
-                                     overwrite=True)
-        uziter.next()
-        self.assertEqual(testfile.open().read(), 'OVERWRITTEN')
-    test_overwrite.suppress = [
-        util.suppress(message="zipstream.unzip is deprecated"),
-        util.suppress(message="zipstream.unzipIter is deprecated")]
-
-
     # XXX these tests are kind of gross and old, but I think unzipIterChunky is
     # kind of a gross function anyway.  We should really write an abstract
     # copyTo/moveTo that operates on FilePath and make sure ZipPath can support
Index: twisted/python/zipstream.py
===================================================================
--- twisted/python/zipstream.py	(revision 34724)
+++ twisted/python/zipstream.py	(working copy)
@@ -7,18 +7,18 @@
 bit of a file at a time, which means you can report progress as a file unzips.
 """
 
-import warnings
 import zipfile
 import os.path
 import zlib
 import struct
 
+
 _fileHeaderSize = struct.calcsize(zipfile.structFileHeader)
 
 class ChunkingZipFile(zipfile.ZipFile):
     """
-    A ZipFile object which, with readfile(), also gives you access to a
-    filelike object for each entry.
+    A C{ZipFile} object which, with L{readfile}, also gives you access to a
+    file-like object for each entry.
     """
 
     def readfile(self, name):
@@ -65,23 +65,23 @@
     Abstract superclass of both compressed and uncompressed variants of
     file-like objects within a zip archive.
 
-    @ivar chunkingZipFile: a chunking zip file.
+    @ivar chunkingZipFile: A chunking zip file.
     @type chunkingZipFile: L{ChunkingZipFile}
 
     @ivar length: The number of bytes within the zip file that represent this
     file.  (This is the size on disk, not the number of decompressed bytes
     which will result from reading it.)
 
-    @ivar fp: the underlying file object (that contains pkzip data).  Do not
+    @ivar fp: The underlying file object (that contains pkzip data).  Do not
     touch this, please.  It will quite likely move or go away.
 
     @ivar closed: File-like 'closed' attribute; True before this file has been
     closed, False after.
-    @type closed: L{bool}
+    @type closed: C{bool}
 
     @ivar finished: An older, broken synonym for 'closed'.  Do not touch this,
     please.
-    @type finished: L{int}
+    @type finished: C{int}
     """
     def __init__(self, chunkingZipFile, length):
         """
@@ -96,14 +96,14 @@
 
     def isatty(self):
         """
-        Returns false because zip files should not be ttys
+        Returns C{False} because zip files should not be ttys.
         """
         return False
 
 
     def close(self):
         """
-        Close self (file-like object)
+        Close self (file-like object).
         """
         self.closed = True
         self.finished = 1
@@ -124,8 +124,8 @@
 
     def next(self):
         """
-        Implement next as file does (like readline, except raises StopIteration
-        at EOF)
+        Implement next as file does (like L{readline}, except raises
+        C{StopIteration} at EOF).
         """
         nextline = self.readline()
         if nextline:
@@ -135,21 +135,21 @@
 
     def readlines(self):
         """
-        Returns a list of all the lines
+        Returns a list of all the lines.
         """
         return list(self)
 
 
     def xreadlines(self):
         """
-        Returns an iterator (so self)
+        Returns an iterator (so self).
         """
         return self
 
 
     def __iter__(self):
         """
-        Returns an iterator (so self)
+        Returns an iterator (so self).
         """
         return self
 
@@ -157,7 +157,7 @@
 
 class ZipFileEntry(_FileEntry):
     """
-    File-like object used to read an uncompressed entry in a ZipFile
+    File-like object used to read an uncompressed entry in a C{ZipFile}.
     """
 
     def __init__(self, chunkingZipFile, length):
@@ -185,7 +185,7 @@
 
 class DeflatedZipFileEntry(_FileEntry):
     """
-    File-like object used to read a deflated entry in a ZipFile
+    File-like object used to read a deflated entry in a C{ZipFile}.
     """
 
     def __init__(self, chunkingZipFile, length):
@@ -238,64 +238,8 @@
 
 
 
-def unzip(filename, directory=".", overwrite=0):
-    """
-    Unzip the file
-
-    @param filename: the name of the zip file
-    @param directory: the directory into which the files will be
-    extracted
-    @param overwrite: if on, overwrite files when they exist.  You can
-    still get an error if you try to create a directory over a file
-    with the same name or vice-versa.
-    """
-    warnings.warn("zipstream.unzip is deprecated since Twisted 11.0.0 for " +
-                  "security reasons.  Use Python's zipfile instead.",
-                  category=DeprecationWarning, stacklevel=2)
-
-    for i in unzipIter(filename, directory, overwrite, suppressWarning=True):
-        pass
-
 DIR_BIT = 16
 
-def unzipIter(filename, directory='.', overwrite=0, suppressWarning=False):
-    """
-    Return a generator for the zipfile.  This implementation will yield
-    after every file.
-
-    The value it yields is the number of files left to unzip.
-    """
-    if not suppressWarning:
-        warnings.warn("zipstream.unzipIter is deprecated since Twisted " +
-                      "11.0.0 for security reasons.  Use Python's " +
-                      "zipfile instead.",
-                      category=DeprecationWarning, stacklevel=2)
-
-    zf = zipfile.ZipFile(filename, 'r')
-    names = zf.namelist()
-    if not os.path.exists(directory):
-        os.makedirs(directory)
-    remaining = len(zf.namelist())
-    for entry in names:
-        remaining -= 1
-        isdir = zf.getinfo(entry).external_attr & DIR_BIT
-        f = os.path.join(directory, entry)
-        if isdir:
-            # overwrite flag only applies to files
-            if not os.path.exists(f):
-                os.makedirs(f)
-        else:
-            # create the directory the file will be in first,
-            # since we can't guarantee it exists
-            fdir = os.path.split(f)[0]
-            if not os.path.exists(fdir):
-                os.makedirs(fdir)
-            if overwrite or not os.path.exists(f):
-                outfile = file(f, 'wb')
-                outfile.write(zf.read(entry))
-                outfile.close()
-        yield remaining
-
 
 def countZipFileChunks(filename, chunksize):
     """
@@ -311,14 +255,14 @@
 
 def countFileChunks(zipinfo, chunksize):
     """
-    Count the number of chunks that will result from the given L{ZipInfo}.
+    Count the number of chunks that will result from the given C{ZipInfo}.
 
-    @param zipinfo: a L{zipfile.ZipInfo} instance describing an entry in a zip
+    @param zipinfo: a C{zipfile.ZipInfo} instance describing an entry in a zip
     archive to be counted.
 
     @return: the number of chunks present in the zip file.  (Even an empty file
     counts as one chunk.)
-    @rtype: L{int}
+    @rtype: C{int}
     """
     count, extra = divmod(zipinfo.file_size, chunksize)
     if extra > 0:
@@ -326,18 +270,6 @@
     return count or 1
 
 
-def countZipFileEntries(filename):
-    """
-    Count the number of entries in a zip archive.  (Don't use this function.)
-
-    @param filename: The filename of a zip archive.
-    @type filename: L{str}
-    """
-    warnings.warn("countZipFileEntries is deprecated.",
-                  DeprecationWarning, 2)
-    zf = zipfile.ZipFile(filename)
-    return len(zf.namelist())
-
 
 def unzipIterChunky(filename, directory='.', overwrite=0,
                     chunksize=4096):
Index: twisted/topfiles/5766.removal
===================================================================
--- twisted/topfiles/5766.removal	(revision 0)
+++ twisted/topfiles/5766.removal	(revision 0)
@@ -0,0 +1 @@
+unzip, unzipIter, and countZipFileEntries in twisted.python.zipstream (deprecated in Twisted 11.0) are removed now.
