summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_netrc.py
diff options
context:
space:
mode:
authorJason Tishler <jason@tishler.net>2003-08-11 12:13:14 (GMT)
committerJason Tishler <jason@tishler.net>2003-08-11 12:13:14 (GMT)
commit0fd54d8050f2a4181066c185e6ac465133646f05 (patch)
tree55a780ddebc79cc50c3c7386a1a06d63fa91fe2c /Lib/test/test_netrc.py
parenta290e3d7c6c15454496d5a8bb163af61f99f52c0 (diff)
downloadcpython-0fd54d8050f2a4181066c185e6ac465133646f05.zip
cpython-0fd54d8050f2a4181066c185e6ac465133646f05.tar.gz
cpython-0fd54d8050f2a4181066c185e6ac465133646f05.tar.bz2
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.
Diffstat (limited to 'Lib/test/test_netrc.py')
-rw-r--r--Lib/test/test_netrc.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/test/test_netrc.py b/Lib/test/test_netrc.py
index 8f4c825..b536255 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)