summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_mmap.py
Commit message (Collapse)AuthorAgeFilesLines
* convert usage of fail* to assert*Benjamin Peterson2009-06-301-2/+2
|
* No behavior change.Hirokazu Yamamoto2009-04-041-2/+2
|
* bounds check arguments to mmap.move(). All of them. Really.Jack Diederich2009-04-011-7/+14
| | | | fixes crasher on OS X 10.5
* Issue #5387: Fixed mmap.move crash by integer overflow. (take2)Hirokazu Yamamoto2009-03-311-4/+16
|
* Issue #5387: Fixed mmap.move crash by integer overflow.Hirokazu Yamamoto2009-03-311-0/+17
|
* Add import_function method to test.test_support, and modify a number ofR. David Murray2009-03-301-2/+3
| | | | | | | | tests that expect to be skipped if imports fail or functions don't exist to use import_function and import_module. The ultimate goal is to change regrtest to not skip automatically on ImportError. Checking in now to make sure the buldbots don't show any errors on platforms I can't direct test on.
* mmap.resize for anonymous map is not working yet, so changed to real file ↵Hirokazu Yamamoto2009-03-051-15/+5
| | | | mapping...
* Issue #5385: Fixed mmap crash after resize failure on windows.Hirokazu Yamamoto2009-03-051-1/+33
| | | | | Now uses NULL instead of INVALID_HANDLE_VALUE as invalid map handle because CreateFileMapping returns NULL when error occurs.
* Issue #1733986: Fixed mmap crash in accessing elements of second map objectHirokazu Yamamoto2009-02-281-0/+28
| | | | with same tagname but larger size than first map. (Windows)
* Issue #5386: mmap.write_byte didn't check map size, so it could cause bufferHirokazu Yamamoto2009-02-281-0/+32
| | | | overrun.
* Issue #5282: Fixed mmap resize on 32bit windows and unix. When offset > 0,Hirokazu Yamamoto2009-02-171-0/+21
| | | | The file was resized to wrong size.
* Issue #5292: Fixed mmap crash on its boundary access m[len(m)].Hirokazu Yamamoto2009-02-171-0/+4
|
* Be sure to close the file. 2 places were deleting the file, so it was probablyNeal Norwitz2008-04-011-1/+3
| | | | | fine, but the last change may be required for the test to pass on Windows. Should we always close the mmap too?
* Issue 2112. mmap does not raises EnvironmentError no more, butFacundo Batista2008-02-171-0/+5
| | | | a subclass of it. Thanks John Lenton.
* mmap.PROT_READ does not exists on win32;Amaury Forgeot d'Arc2008-02-161-0/+2
| | | | Skip this test created by r60830.
* Bug #2111: mmap segfaults when trying to write a block opened with PROT_READChristian Heimes2008-02-151-0/+7
| | | | Thanks to Thomas Herve for the fix.
* Fix for #1087741 patch.Georg Brandl2008-01-221-0/+7
|
* Patch #976880: add mmap .rfind() method, and 'end' paramter to .find().Andrew M. Kuchling2008-01-191-0/+36
| | | | Contributed by John Lenton.
* Add phuang patch from Issue 708374 which adds offset parameter to mmap module.Travis E. Oliphant2007-10-231-0/+44
|
* Improve extended slicing support in builtin types and classes. Specifically:Thomas Wouters2007-08-281-0/+34
| | | | | | | | | | | | | | | | | | | | - Specialcase extended slices that amount to a shallow copy the same way as is done for simple slices, in the tuple, string and unicode case. - Specialcase step-1 extended slices to optimize the common case for all involved types. - For lists, allow extended slice assignment of differing lengths as long as the step is 1. (Previously, 'l[:2:1] = []' failed even though 'l[:2] = []' and 'l[:2:None] = []' do not.) - Implement extended slicing for buffer, array, structseq, mmap and UserString.UserString. - Implement slice-object support (but not non-step-1 slice assignment) for UserString.MutableString. - Add tests for all new functionality.
* Whitespace normalization.Tim Peters2006-11-031-1/+1
|
* Convert test_mmap to unittest.Georg Brandl2006-10-291-238/+156
|
* Patch #1407135, bug #1424041, make mmap.mmap(-1, length) work the sameNeal Norwitz2006-02-051-2/+12
| | | | | | | | | | | on both Unix (SVR4 and BSD) and Windows. Restores behaviour of passing -1 for anonymous memory on Unix. Use MAP_ANONYMOUS instead of _ANON since the latter is deprecated according to Linux (gentoo) man pages. Should we continue to allow mmap.mmap(0, length) to work on Windows? 0 is a valid fd. Will backport bugfix portions.
* Fix SF bug #1402308, segfault when using mmap(-1, ...)Neal Norwitz2006-01-111-0/+8
| | | | | | | This didn't crash on Linux, but valgrind complained. I'm not sure if this test is valid on Windows. Will backport.
* SF Patch #1365916, mmap fails on AMD64Neal Norwitz2005-12-181-0/+16
| | | | Fix some 64-bit issues due to mismatch format characters w/actual data types
* Whitespace normalization (via reindent.py).Tim Peters2005-08-261-1/+1
|
* bug [ 728515 ] mmap's resize method resizes the file in win32 but not unixGeorg Brandl2005-08-241-0/+8
|
* Whitespace normalization.Tim Peters2005-03-281-6/+6
|
* Patches #749830, #1144555: allow UNIX mmap size to default to currentMartin v. Löwis2005-03-031-0/+36
| | | | file size.
* A new test here was failing on Windows, because the test before it neverTim Peters2003-01-131-10/+5
| | | | | managed to delete the @test file it intended to delete. Also, I don't see a reason to create a 4MB file in the new test, so cut it back to 16K.
* SF #665913, Fix mmap module core dump with unixNeal Norwitz2003-01-101-0/+18
| | | | | | Closing an mmap'ed file (calling munmap) twice on Solaris caused a core dump. Will backport.
* test_both(): I believe this was a typo: m is only defined if noBarry Warsaw2002-09-111-1/+1
| | | | | | | | | | | | exception occurred so it should only be closed in the else clause. Without this change we can an UnboundLocalError on Linux: Traceback (most recent call last): File "Lib/test/test_mmap.py", line 304, in ? test_both() File "Lib/test/test_mmap.py", line 208, in test_both m.close() UnboundLocalError: local variable 'm' referenced before assignment
* I left some debugging junk in here; removed it. Also replaced a fewTim Peters2002-09-101-2/+3
| | | | | more instances of the bizarre "del f; del m" ways to spell .close() (del won't do any good here under Jython, etc).
* A few days ago a test was added here to ensure that creating an mmapTim Peters2002-09-101-4/+15
| | | | | | | | | | with a size larger than the underlying file worked on Windows. It does <wink>. However, merely creating an mmap that way has the side effect of growing the file on disk to match the specified size. A *later* test assumed that the file on disk was still exactly as it was before the new "size too big" test was added, but that's no longer true. So added a hack at the end of the "size too big" test to truncate the disk file back to its original size on Windows.
* Try to get test to pass on WindowsNeal Norwitz2002-09-071-1/+2
|
* SF bug # 585792, Invalid mmap crashes Python interpreterNeal Norwitz2002-09-051-0/+15
| | | | | Raise ValueError if user passes a size to mmap which is larger than the file.
* Get rid of relative imports in all unittests. Now anything thatBarry Warsaw2002-07-231-1/+1
| | | | | | | | | | | imports e.g. test_support must do so using an absolute package name such as "import test.test_support" or "from test import test_support". This also updates the README in Lib/test, and gets rid of the duplicate data dirctory in Lib/test/data (replaced by Lib/email/test/data). Now Tim and Jack can have at it. :)
* test_mmap started breaking on Windows, only when run after test_bsddb.Tim Peters2002-04-231-1/+1
| | | | | | | | | On Win2K it thought 'foo' started at byte offset 0 instead of at the pagesize, and on Win98 it thought 'foo' didn't exist at all. Somehow or other this is related to the new "in memory file" gimmicks in bsddb, but the old bsddb we use on Windows sucks so bad anyway I don't want to bother digging deeper. Flushing the file in test_mmap after writing to it makes the problem go away, so good enough.
* SF bug 544733: Cygwin test_mmap fix for Python 2.2.1Tim Peters2002-04-181-0/+2
| | | | | | | | Close a file before trying to unlink it, and apparently Cygwin needs writes to an mmap'ed file to get flushed before they're visible. Bugfix candidate, but I think only for the 2.2 line (it's testing features that I think were new in 2.2).
* SF bug 515943: searching for data with \0 in mmap.Tim Peters2002-03-081-0/+25
| | | | | | | | | mmap_find_method(): this obtained the string to find via s#, but it ignored its length, acting as if it were \0-terminated instead. Someone please run on Linux too (the extended test_mmap works on Windows). Bugfix candidate.
* Removed print that executes only on Unix boxes; that made it impossibleTim Peters2001-11-131-2/+2
| | | | to have single "expected output" file.
* CVS patch #477161: New "access" keyword for mmap, from Jay T Miller.Tim Peters2001-11-131-13/+125
| | | | | | | | | | This gives mmap() on Windows the ability to create read-only, write- through and copy-on-write mmaps. A new keyword argument is introduced because the mmap() signatures diverged between Windows and Unix, so while they (now) both support this functionality, there wasn't a way to spell it in a common way without introducing a new spelling gimmick. The old spellings are still accepted, so there isn't a backward- compatibility issue here.
* unlink() would normally be found in the "os" module, so use it from there.Fred Drake2001-05-111-5/+7
| | | | | | | | Remove unused import of "sys". If the file TESTFN exists before we start, try to remove it. Add spaces around the = in some assignments.
* Change test_mmap.py to use test_support.TESTFN instead of hardcoded "foo",Tim Peters2001-05-101-108/+119
| | | | | and wrap the body in try/finally to ensure TESTFN gets cleaned up no matter what.
* String method conversion.Eric S. Raymond2001-02-091-3/+3
|
* This patch removes all uses of "assert" in the regression test suiteMarc-André Lemburg2001-01-171-17/+19
| | | | | | | and replaces them with a new API verify(). As a result the regression suite will also perform its tests in optimization mode. Written by Marc-Andre Lemburg. Copyright assigned to Guido van Rossum.
* SF bug 128713: type(mmap_object) blew up on Linux.Tim Peters2001-01-141-0/+2
|
* Update the code to better reflect recommended style:Fred Drake2000-12-121-1/+1
| | | | | Use != instead of <> since <> is documented as "obsolescent". Use "is" and "is not" when comparing with None or type objects.
* Make reindent.py happy (convert everything to 4-space indents!).Fred Drake2000-10-231-11/+10
|
* test_mmap wrote null bytes into its expected-output file; this caused me toTim Peters2000-09-041-2/+1
| | | | | | | | | | | waste an hour tracking down an illusion; repaired it; writing/reading non- printable characters (except \t\r\n) into/outof text-mode files ain't defined x-platform, and at least some Windows text editors do surprising things in their presence. Also added a by-hand "build humber" to the Windows build, in an approximation of Python's inexplicable BUILD-number Unix scheme. I'll try to remember to increment it each time I make a Windows installer available. It's starting at 2, cuz I've put 2 installers out so far (both with BUILD #0).