mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
SF Patch #1365916, mmap fails on AMD64
Fix some 64-bit issues due to mismatch format characters w/actual data types
This commit is contained in:
parent
84456bdab3
commit
8856fb750b
3 changed files with 30 additions and 12 deletions
|
@ -356,6 +356,22 @@ def test_both():
|
|||
finally:
|
||||
os.unlink(TESTFN)
|
||||
|
||||
# make move works everywhere (64-bit format problem earlier)
|
||||
f = open(TESTFN, 'w+')
|
||||
|
||||
try: # unlink TESTFN no matter what
|
||||
f.write("ABCDEabcde") # Arbitrary character
|
||||
f.flush()
|
||||
|
||||
mf = mmap.mmap(f.fileno(), 10)
|
||||
mf.move(5, 0, 5)
|
||||
verify(mf[:] == "ABCDEABCDE", "Map move should have duplicated front 5")
|
||||
mf.close()
|
||||
f.close()
|
||||
|
||||
finally:
|
||||
os.unlink(TESTFN)
|
||||
|
||||
print ' Test passed'
|
||||
|
||||
test_both()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue