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.
- 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.
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.
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
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.
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. :)
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.
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).
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.
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.
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.