Skip to content

Commit 6113378

Browse files
Fix some tests.
1 parent 346b808 commit 6113378

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

Lib/test/test_frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ def __del__(self):
253253
def gen():
254254
yield
255255
256-
fd = open({__file__!r})
256+
fd = open({__file__!r}, 'rb')
257257
l = [fd, GCHello()]
258258
l.append(l)
259259
del fd

Lib/test/test_mailcap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def test_listmailcapfiles(self):
9393

9494
def test_readmailcapfile(self):
9595
# Test readmailcapfile() using test file. It should match MAILCAPDICT.
96-
with open(MAILCAPFILE, 'r') as mcf:
96+
with open(MAILCAPFILE, 'r', encoding='utf-8') as mcf:
9797
with self.assertWarns(DeprecationWarning):
9898
d = mailcap.readmailcapfile(mcf)
9999
self.assertDictEqual(d, MAILCAPDICT_DEPRECATED)

Lib/test/test_xml_etree.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3717,10 +3717,6 @@ def test_write_to_filename_with_encoding(self):
37173717

37183718
def test_write_to_filename_as_unicode(self):
37193719
self.addCleanup(os_helper.unlink, TESTFN)
3720-
with open(TESTFN, 'w') as f:
3721-
encoding = f.encoding
3722-
os_helper.unlink(TESTFN)
3723-
37243720
tree = ET.ElementTree(ET.XML('''<site>\xf8</site>'''))
37253721
tree.write(TESTFN, encoding='unicode')
37263722
with open(TESTFN, 'rb') as f:

0 commit comments

Comments
 (0)