Commit Graph

20 Commits

Author SHA1 Message Date
Tim Peters c9ffa068d1 SF bug 515943: searching for data with \0 in mmap.
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.
2002-03-08 05:43:32 +00:00
Tim Peters 00cafa0f76 Removed print that executes only on Unix boxes; that made it impossible
to have single "expected output" file.
2001-11-13 23:39:47 +00:00
Tim Peters 5ebfd36afa CVS patch #477161: New "access" keyword for mmap, from Jay T Miller.
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.
2001-11-13 23:11:19 +00:00
Fred Drake 6278799f8e unlink() would normally be found in the "os" module, so use it from there.
Remove unused import of "sys".

If the file TESTFN exists before we start, try to remove it.

Add spaces around the = in some assignments.
2001-05-11 14:29:21 +00:00
Tim Peters fd69208b78 Change test_mmap.py to use test_support.TESTFN instead of hardcoded "foo",
and wrap the body in try/finally to ensure TESTFN gets cleaned up no
matter what.
2001-05-10 20:03:04 +00:00
Eric S. Raymond fc170b1fd5 String method conversion. 2001-02-09 11:51:27 +00:00
Marc-André Lemburg 3661908a6a This patch removes all uses of "assert" in the regression test suite
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.
2001-01-17 19:11:13 +00:00
Tim Peters 2caf8df868 SF bug 128713: type(mmap_object) blew up on Linux. 2001-01-14 05:05:51 +00:00
Fred Drake 132dce2246 Update the code to better reflect recommended style:
Use != instead of <> since <> is documented as "obsolescent".
Use "is" and "is not" when comparing with None or type objects.
2000-12-12 23:11:42 +00:00
Fred Drake 004d5e6880 Make reindent.py happy (convert everything to 4-space indents!). 2000-10-23 17:22:08 +00:00
Tim Peters 50699215f8 test_mmap wrote null bytes into its expected-output file; this caused me to
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).
2000-09-04 07:34:06 +00:00
Thomas Wouters a701597138 Fix inconsistent use of tab/space in indentation. 2000-07-30 15:38:35 +00:00
Mark Hammond af4cfae300 Test that after resizing the mmap'd file, we can't seek beyond the new size. 2000-07-30 02:20:38 +00:00
Peter Schneider-Kamp 7a11671e8b fixed inconsistent use of tab and spaces 2000-07-11 11:24:41 +00:00
Andrew M. Kuchling d3cf692c38 Add test of resize() method of mmap objects 2000-07-11 10:45:28 +00:00
Andrew M. Kuchling cf70ea633f Additional tests for seek() method, written by Trent Mick 2000-06-18 04:47:08 +00:00
Fred Drake 605843f0c0 Mark Hammond:
This patch fixes the mmap module on Windows 9x.

Also updates the mmap test to remove the test file.
2000-04-05 14:17:11 +00:00
Guido van Rossum 706dbd03bd Mark Hammond: Ooops - even though Win32 handles the same args, there
was a superfluous check for the platform.
2000-03-31 01:20:33 +00:00
Guido van Rossum 767e775a98 Improved test, by Mark Hammond, for Win32. 2000-03-31 01:09:14 +00:00
Andrew M. Kuchling e81b9cfcfe Added simple test case for mmap on Unix; someone needs to write a
Win32 test case
2000-03-30 21:15:29 +00:00