Commit 3fa5e6ee authored by Andrew M. Kuchling's avatar Andrew M. Kuchling

[Bug #776202] Apply Walter Doerwald's patch to use text mode for encoded files

parent 9ef0ef5b
......@@ -114,11 +114,11 @@ class UUFileTest(unittest.TestCase):
def test_encode(self):
try:
fin = open(self.tmpin, 'wb')
fin = open(self.tmpin, 'w')
fin.write(plaintext)
fin.close()
fin = open(self.tmpin, 'rb')
fin = open(self.tmpin, 'r')
fout = open(self.tmpout, 'w')
uu.encode(fin, fout, self.tmpin, mode=0644)
fin.close()
......@@ -130,7 +130,7 @@ class UUFileTest(unittest.TestCase):
self.assertEqual(s, encodedtextwrapped % (0644, self.tmpin))
# in_file and out_file as filenames
uu.encode(self.tmpin, self.tmpout, mode=0644)
uu.encode(self.tmpin, self.tmpout, self.tmpin, mode=0644)
fout = open(self.tmpout, 'r')
s = fout.read()
fout.close()
......@@ -142,11 +142,11 @@ class UUFileTest(unittest.TestCase):
def test_decode(self):
try:
f = open(self.tmpin, 'wb')
f = open(self.tmpin, 'w')
f.write(encodedtextwrapped % (0644, self.tmpout))
f.close()
f = open(self.tmpin, 'rb')
f = open(self.tmpin, 'r')
uu.decode(f)
f.close()
......@@ -163,11 +163,11 @@ class UUFileTest(unittest.TestCase):
try:
f = cStringIO.StringIO(encodedtextwrapped % (0644, self.tmpout))
f = open(self.tmpin, 'rb')
f = open(self.tmpin, 'r')
uu.decode(f)
f.close()
f = open(self.tmpin, 'rb')
f = open(self.tmpin, 'r')
self.assertRaises(uu.Error, uu.decode, f)
f.close()
finally:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment