Skip to content

Commit 80bdb48

Browse files
committed
Revert r52798, r52803, r52824, r54342, as they don't fix
security issues.
1 parent c350602 commit 80bdb48

File tree

5 files changed

+8
-31
lines changed

5 files changed

+8
-31
lines changed

Lib/email/Charset.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Copyright (C) 2001-2007 Python Software Foundation
2-
# Author: email-sig@python.org
1+
# Copyright (C) 2001-2006 Python Software Foundation
2+
# Author: che@debian.org (Ben Gertzfield), barry@python.org (Barry Warsaw)
33

44
from types import UnicodeType
55
from email.Encoders import encode_7or8bit
@@ -99,7 +99,7 @@ def _isunicode(s):
9999
# of stability and useability.
100100

101101
CODEC_MAP = {
102-
'gb2312': 'eucgb2312_cn',
102+
'gb2132': 'eucgb2312_cn',
103103
'big5': 'big5_tw',
104104
'utf-8': 'utf-8',
105105
# Hack: We don't want *any* conversion for stuff marked us-ascii, as all

Lib/email/__init__.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# Copyright (C) 2001-2007 Python Software Foundation
2-
# Author: email-sig@python.org
1+
# Copyright (C) 2001-2006 Python Software Foundation
2+
# Author: barry@python.org (Barry Warsaw)
33

44
"""A package for parsing, handling, and generating email messages."""
55

6-
__version__ = '2.5.9'
6+
__version__ = '2.5.8'
77

88
__all__ = [
99
'base64MIME',

Lib/fileinput.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -301,9 +301,7 @@ def readline(self):
301301
self._file = open(self._backupfilename, "r")
302302
try:
303303
perm = os.fstat(self._file.fileno()).st_mode
304-
except (AttributeError, OSError):
305-
# AttributeError occurs in Jython, where there's no
306-
# os.fstat.
304+
except OSError:
307305
self._output = open(self._filename, "w")
308306
else:
309307
fd = os.open(self._filename,

Lib/test/test_sha.py

+1-18
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,9 @@
1111

1212
class SHATestCase(unittest.TestCase):
1313
def check(self, data, digest):
14-
# Check digest matches the expected value
15-
obj = sha.new(data)
16-
computed = obj.hexdigest()
14+
computed = sha.new(data).hexdigest()
1715
self.assert_(computed == digest)
1816

19-
# Verify that the value doesn't change between two consecutive
20-
# digest operations.
21-
computed_again = obj.hexdigest()
22-
self.assert_(computed == computed_again)
23-
24-
# Check hexdigest() output matches digest()'s output
25-
digest = obj.digest()
26-
hexd = ""
27-
for c in digest:
28-
hexd += '%02x' % ord(c)
29-
self.assert_(computed == hexd)
30-
3117
def test_case_1(self):
3218
self.check("abc",
3319
"a9993e364706816aba3e25717850c26c9cd0d89d")
@@ -40,9 +26,6 @@ def test_case_3(self):
4026
self.check("a" * 1000000,
4127
"34aa973cd4c4daa4f61eeb2bdbad27316534016f")
4228

43-
def test_case_4(self):
44-
self.check(chr(0xAA) * 80,
45-
'4ca0ef38f1794b28a8f8ee110ee79d48ce13be25')
4629

4730
def test_main():
4831
test_support.run_unittest(SHATestCase)

Lib/uu.py

-4
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ def decode(in_file, out_file=None, mode=None, quiet=0):
115115
#
116116
# Open the output file
117117
#
118-
opened = False
119118
if out_file == '-':
120119
out_file = sys.stdout
121120
elif isinstance(out_file, StringType):
@@ -125,7 +124,6 @@ def decode(in_file, out_file=None, mode=None, quiet=0):
125124
except AttributeError:
126125
pass
127126
out_file = fp
128-
opened = True
129127
#
130128
# Main decoding loop
131129
#
@@ -143,8 +141,6 @@ def decode(in_file, out_file=None, mode=None, quiet=0):
143141
s = in_file.readline()
144142
if not s:
145143
raise Error, 'Truncated input file'
146-
if opened:
147-
out_file.close()
148144

149145
def test():
150146
"""uuencode/uudecode main program"""

0 commit comments

Comments
 (0)