summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_largefile.py
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-09-06 00:32:15 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-09-06 00:32:15 (GMT)
commit6e13a562ae01a962612ca76f9afcc7211240236e (patch)
tree272a23269db39f82d12388554cac8497f2dc4bab /Lib/test/test_largefile.py
parent97f4a33e125dc14c72070bbf38f723aaa26b9df7 (diff)
downloadcpython-6e13a562ae01a962612ca76f9afcc7211240236e.zip
cpython-6e13a562ae01a962612ca76f9afcc7211240236e.tar.gz
cpython-6e13a562ae01a962612ca76f9afcc7211240236e.tar.bz2
Enable large file support on Win32 systems.
Curious: the MS docs say stati64 etc are supported even on Win95, but Win95 doesn't support a filesystem that allows partitions > 2 Gb. test_largefile: This was opening its test file in text mode. I have no idea how that worked under Win64, but it sure needs binary mode on Win98. BTW, on Win98 test_largefile runs quickly (under a second).
Diffstat (limited to 'Lib/test/test_largefile.py')
-rw-r--r--Lib/test/test_largefile.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_largefile.py b/Lib/test/test_largefile.py
index 54fd274..3f3b8f1 100644
--- a/Lib/test/test_largefile.py
+++ b/Lib/test/test_largefile.py
@@ -12,7 +12,7 @@ import os, struct, stat, sys
# only run if the current system support large files
-f = open(test_support.TESTFN, 'w')
+f = open(test_support.TESTFN, 'wb')
try:
# 2**31 == 2147483648
f.seek(2147483649L)
@@ -58,13 +58,13 @@ def expect(got_this, expect_this):
if test_support.verbose:
print 'create large file via seek (may be sparse file) ...'
-f = open(name, 'w')
+f = open(name, 'wb')
f.seek(size)
f.write('a')
f.flush()
-expect(os.fstat(f.fileno())[stat.ST_SIZE], size+1)
if test_support.verbose:
print 'check file size with os.fstat'
+expect(os.fstat(f.fileno())[stat.ST_SIZE], size+1)
f.close()
if test_support.verbose:
print 'check file size with os.stat'
@@ -72,7 +72,7 @@ expect(os.stat(name)[stat.ST_SIZE], size+1)
if test_support.verbose:
print 'play around with seek() and read() with the built largefile'
-f = open(name, 'r')
+f = open(name, 'rb')
expect(f.tell(), 0)
expect(f.read(1), '\000')
expect(f.tell(), 1)