]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Revert r52798, r52803, r52824, r54342, as they don't fix
authorMartin v. Löwis <martin@v.loewis.de>
Sun, 2 Mar 2008 17:15:58 +0000 (17:15 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Sun, 2 Mar 2008 17:15:58 +0000 (17:15 +0000)
security issues.

Lib/email/Charset.py
Lib/email/__init__.py
Lib/fileinput.py
Lib/test/test_sha.py
Lib/uu.py

index 0751abfb94ed1ef90f155eb3055eec9ec83a46ee..fb4e5a9b185d84b229fa613f5f8ad9ffe38c089e 100644 (file)
@@ -1,5 +1,5 @@
-# Copyright (C) 2001-2007 Python Software Foundation
-# Author: email-sig@python.org
+# Copyright (C) 2001-2006 Python Software Foundation
+# Author: che@debian.org (Ben Gertzfield), barry@python.org (Barry Warsaw)
 
 from types import UnicodeType
 from email.Encoders import encode_7or8bit
@@ -99,7 +99,7 @@ ALIASES = {
 # of stability and useability.
 
 CODEC_MAP = {
-    'gb2312':   'eucgb2312_cn',
+    'gb2132':   'eucgb2312_cn',
     'big5':     'big5_tw',
     'utf-8':    'utf-8',
     # Hack: We don't want *any* conversion for stuff marked us-ascii, as all
index 1531140e6d39f86743be2d0b217c3a77d9485459..1e03b0085f76db99da8ab85ebea1184371bfd0f5 100644 (file)
@@ -1,9 +1,9 @@
-# Copyright (C) 2001-2007 Python Software Foundation
-# Author: email-sig@python.org
+# Copyright (C) 2001-2006 Python Software Foundation
+# Author: barry@python.org (Barry Warsaw)
 
 """A package for parsing, handling, and generating email messages."""
 
-__version__ = '2.5.9'
+__version__ = '2.5.8'
 
 __all__ = [
     'base64MIME',
index 75938585793aa2924304aeb4baf784ea29622428..27ccc3bfedfd7a5b2584258b86228f4df2f89c78 100644 (file)
@@ -301,9 +301,7 @@ class FileInput:
                     self._file = open(self._backupfilename, "r")
                     try:
                         perm = os.fstat(self._file.fileno()).st_mode
-                    except (AttributeError, OSError):
-                       # AttributeError occurs in Jython, where there's no
-                       # os.fstat.
+                    except OSError:
                         self._output = open(self._filename, "w")
                     else:
                         fd = os.open(self._filename,
index ea224e439c3d5c60b415bb73f846c1f41ba2c20b..c438cc6417efb5ef20929d1ab830e37f8e9a3319 100644 (file)
@@ -11,23 +11,9 @@ from test import test_support
 
 class SHATestCase(unittest.TestCase):
     def check(self, data, digest):
-        # Check digest matches the expected value
-        obj = sha.new(data)
-        computed = obj.hexdigest()
+        computed = sha.new(data).hexdigest()
         self.assert_(computed == digest)
 
-        # Verify that the value doesn't change between two consecutive
-        # digest operations.
-        computed_again = obj.hexdigest()
-        self.assert_(computed == computed_again)
-
-        # Check hexdigest() output matches digest()'s output
-        digest = obj.digest()
-        hexd = ""
-        for c in digest:
-            hexd += '%02x' % ord(c)
-        self.assert_(computed == hexd)
-
     def test_case_1(self):
         self.check("abc",
                    "a9993e364706816aba3e25717850c26c9cd0d89d")
@@ -40,9 +26,6 @@ class SHATestCase(unittest.TestCase):
         self.check("a" * 1000000,
                    "34aa973cd4c4daa4f61eeb2bdbad27316534016f")
 
-    def test_case_4(self):
-        self.check(chr(0xAA) * 80,
-                   '4ca0ef38f1794b28a8f8ee110ee79d48ce13be25')
 
 def test_main():
     test_support.run_unittest(SHATestCase)
index fd3e32731f4575ec0e4b4491333337dda8519ccf..f5917983f6b9230e336795a945e5b512a8277191 100755 (executable)
--- a/Lib/uu.py
+++ b/Lib/uu.py
@@ -115,7 +115,6 @@ def decode(in_file, out_file=None, mode=None, quiet=0):
     #
     # Open the output file
     #
-    opened = False
     if out_file == '-':
         out_file = sys.stdout
     elif isinstance(out_file, StringType):
@@ -125,7 +124,6 @@ def decode(in_file, out_file=None, mode=None, quiet=0):
         except AttributeError:
             pass
         out_file = fp
-        opened = True
     #
     # Main decoding loop
     #
@@ -143,8 +141,6 @@ def decode(in_file, out_file=None, mode=None, quiet=0):
         s = in_file.readline()
     if not s:
         raise Error, 'Truncated input file'
-    if opened:
-        out_file.close()
 
 def test():
     """uuencode/uudecode main program"""