Kaydet (Commit) 0fd54d80 authored tarafından Jason Tishler's avatar Jason Tishler

Unconditionally opening the temp file in text mode causes this test to fail

under Cygwin. The attached patch corrects this problem.

I tested this patch under Red Hat Linux 8.0 too.
üst a290e3d7
import netrc, os, unittest import netrc, os, unittest, sys
from test import test_support from test import test_support
TEST_NETRC = """ TEST_NETRC = """
...@@ -22,7 +22,10 @@ temp_filename = test_support.TESTFN ...@@ -22,7 +22,10 @@ temp_filename = test_support.TESTFN
class NetrcTestCase(unittest.TestCase): class NetrcTestCase(unittest.TestCase):
def setUp (self): def setUp (self):
fp = open(temp_filename, 'wt') mode = 'w'
if sys.platform not in ['cygwin']:
mode += 't'
fp = open(temp_filename, mode)
fp.write(TEST_NETRC) fp.write(TEST_NETRC)
fp.close() fp.close()
self.netrc = netrc.netrc(temp_filename) self.netrc = netrc.netrc(temp_filename)
......
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