From: Tim Peters Date: Thu, 15 Jun 2006 18:06:29 +0000 (+0000) Subject: Whitespace normalization. X-Git-Tag: v2.5b1~38 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a608bb228cd4ce83a30f08dc292645ceb6108ed4;p=python Whitespace normalization. --- diff --git a/Lib/test/test_zipfile.py b/Lib/test/test_zipfile.py index a409d5cdf8..54684f3bbe 100644 --- a/Lib/test/test_zipfile.py +++ b/Lib/test/test_zipfile.py @@ -46,7 +46,7 @@ class TestsWithSourceFile(unittest.TestCase): zipfp.printdir() finally: sys.stdout = stdout - + directory = fp.getvalue() lines = directory.splitlines() self.assertEquals(len(lines), 4) # Number of files + header @@ -133,13 +133,13 @@ class TestZip64InSmallFiles(unittest.TestCase): def largeFileExceptionTest(self, f, compression): zipfp = zipfile.ZipFile(f, "w", compression) - self.assertRaises(zipfile.LargeZipFile, + self.assertRaises(zipfile.LargeZipFile, zipfp.write, TESTFN, "another"+os.extsep+"name") zipfp.close() def largeFileExceptionTest2(self, f, compression): zipfp = zipfile.ZipFile(f, "w", compression) - self.assertRaises(zipfile.LargeZipFile, + self.assertRaises(zipfile.LargeZipFile, zipfp.writestr, "another"+os.extsep+"name", self.data) zipfp.close() @@ -171,7 +171,7 @@ class TestZip64InSmallFiles(unittest.TestCase): zipfp.printdir() finally: sys.stdout = stdout - + directory = fp.getvalue() lines = directory.splitlines() self.assertEquals(len(lines), 4) # Number of files + header diff --git a/Lib/zipfile.py b/Lib/zipfile.py index 2cdbc6fad4..865267a7cc 100644 --- a/Lib/zipfile.py +++ b/Lib/zipfile.py @@ -17,7 +17,7 @@ class BadZipfile(Exception): class LargeZipFile(Exception): - """ + """ Raised when writing a zipfile, the zipfile requires ZIP64 extensions and those extensions are disabled. """ @@ -99,20 +99,20 @@ def _EndRecData64(fpin, offset, endrec): fpin.seek(offset - locatorSize, 2) data = fpin.read(locatorSize) sig, diskno, reloff, disks = struct.unpack(structEndArchive64Locator, data) - if sig != stringEndArchive64Locator: + if sig != stringEndArchive64Locator: return endrec if diskno != 0 or disks != 1: raise BadZipfile("zipfiles that span multiple disks are not supported") - # Assume no 'zip64 extensible data' + # Assume no 'zip64 extensible data' endArchiveSize = struct.calcsize(structEndArchive64) fpin.seek(offset - locatorSize - endArchiveSize, 2) data = fpin.read(endArchiveSize) sig, sz, create_version, read_version, disk_num, disk_dir, \ dircount, dircount2, dirsize, diroffset = \ struct.unpack(structEndArchive64, data) - if sig != stringEndArchive64: + if sig != stringEndArchive64: return endrec # Update the original endrec using data from the ZIP64 record @@ -294,7 +294,7 @@ class ZipInfo (object): idx+=1 extra = extra[ln+4:] - + class ZipFile: """ Class with methods to open, read, write, close, list zip files. @@ -642,7 +642,7 @@ class ZipFile: records.""" if self.fp is None: return - + if self.mode in ("w", "a") and self._didModify: # write ending records count = 0 pos1 = self.fp.tell() @@ -674,7 +674,7 @@ class ZipFile: extra_data = struct.pack( '