summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_largefile.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-01-31 22:47:27 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-01-31 22:47:27 (GMT)
commit905a2ffe3e5445925a669ab433521ddb66cf1043 (patch)
treef3a63e9771498b63eebb2797deaede3577695aaf /Lib/test/test_largefile.py
parent9b661e6ef636bdd71639befc11e7ce71755f6421 (diff)
downloadcpython-905a2ffe3e5445925a669ab433521ddb66cf1043.zip
cpython-905a2ffe3e5445925a669ab433521ddb66cf1043.tar.gz
cpython-905a2ffe3e5445925a669ab433521ddb66cf1043.tar.bz2
Merged revisions 77890 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r77890 | antoine.pitrou | 2010-01-31 23:26:04 +0100 (dim., 31 janv. 2010) | 7 lines - Issue #6939: Fix file I/O objects in the `io` module to keep the original file position when calling `truncate()`. It would previously change the file position to the given argument, which goes against the tradition of ftruncate() and other truncation APIs. Patch by Pascal Chambon. ........
Diffstat (limited to 'Lib/test/test_largefile.py')
-rw-r--r--Lib/test/test_largefile.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_largefile.py b/Lib/test/test_largefile.py
index 7fd3e0e..1c6297a 100644
--- a/Lib/test/test_largefile.py
+++ b/Lib/test/test_largefile.py
@@ -122,14 +122,14 @@ class LargeFileTest(unittest.TestCase):
newsize -= 1
f.seek(42)
f.truncate(newsize)
- self.assertEqual(f.tell(), newsize) # else wasn't truncated
+ self.assertEqual(f.tell(), 42)
f.seek(0, 2)
self.assertEqual(f.tell(), newsize)
# XXX truncate(larger than true size) is ill-defined
# across platform; cut it waaaaay back
f.seek(0)
f.truncate(1)
- self.assertEqual(f.tell(), 1) # else pointer moved
+ self.assertEqual(f.tell(), 0) # else pointer moved
f.seek(0)
self.assertEqual(len(f.read()), 1) # else wasn't truncated