From: Jason Tishler Date: Mon, 11 Aug 2003 12:13:45 +0000 (+0000) Subject: Unconditionally opening the temp file in text mode causes this test to fail X-Git-Tag: v2.3.1~161 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=03474027a32e9cda84e4af7679b4bf5f40bd6d65;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Lib/test/test_netrc.py b/Lib/test/test_netrc.py index 8f4c825b2690..b536255aba3d 100644 --- a/Lib/test/test_netrc.py +++ b/Lib/test/test_netrc.py @@ -1,5 +1,5 @@ -import netrc, os, unittest +import netrc, os, unittest, sys from test import test_support TEST_NETRC = """ @@ -22,7 +22,10 @@ temp_filename = test_support.TESTFN class NetrcTestCase(unittest.TestCase): 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.close() self.netrc = netrc.netrc(temp_filename)