Merge from 3.2:
- Issue #9651: Fix a crash when ctypes.create_string_buffer(0) was passed to file.write()
- Issue #11241: subclasses of ctypes.Array can now be subclassed.
Antoine Pitrou [Tue, 30 Aug 2011 16:34:47 +0000 (18:34 +0200)]
Remove misleading comment and code.
Windows does set the errno attribute to ENOENT, but the error message
displays the Windows error number (3 -> ERROR_PATH_NOT_FOUND), not the
errno number (2 -> ENOENT).
The Unix errno corresponding to 3 is ESRCH, explaining the confusion,
which can be seen in the following snippet:
>>> shutil.rmtree("foo")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "Z:\default\lib\shutil.py", line 272, in rmtree
onerror(os.listdir, path, sys.exc_info())
File "Z:\default\lib\shutil.py", line 270, in rmtree
names = os.listdir(path)
WindowsError: [Error 3] The system cannot find the path specified:
'foo\\*.*'
>>> e = sys.last_value
>>> e.errno
2
>>> e.winerror
3
>>> errno.errorcode[2]
'ENOENT'
For reference, see PC/errmap.h and
http://msdn.microsoft.com/en-us/library/ms681382%28v=vs.85%29.aspx
Éric Araujo [Mon, 29 Aug 2011 23:42:50 +0000 (01:42 +0200)]
Make bdist_* commands respect --skip-build passed to bdist (#10946).
There was already a test for this, but it was complicated and had a
subtle bug (custom command objects need to be put in dist.command_obj so
that other command objects may see them) that rendered it moot.
Éric Araujo [Mon, 29 Aug 2011 23:19:02 +0000 (01:19 +0200)]
Remove obsolete mentions of the compress program and .Z archives.
Packaging uses the shutil.make_archive function copied from distutils,
which does not support compress. There is no test to check that
“bdist --format whatever” works, so this slipped by.
Éric Araujo [Mon, 29 Aug 2011 22:55:02 +0000 (00:55 +0200)]
Remove display options (--name, etc.) from the Distribution class.
These options were used to implement “setup.py --name”,
“setup.py --version”, etc. which are now handled by the pysetup metadata
action or direct parsing of the setup.cfg file.
As a side effect, the Distribution class no longer accepts a 'url' key
in its *attrs* argument: it has to be 'home-page' to be recognized as a
valid metadata field and passed down to the dist.metadata object.
I cleaned up some comments, docstrings and code along the way.
Antoine Pitrou [Mon, 29 Aug 2011 21:14:53 +0000 (23:14 +0200)]
Issue #11564: Avoid crashes when trying to pickle huge objects or containers
(more than 2**31 items). Instead, in most cases, an OverflowError is raised.
Antoine Pitrou [Mon, 29 Aug 2011 21:09:33 +0000 (23:09 +0200)]
Issue #11564: Avoid crashes when trying to pickle huge objects or containers
(more than 2**31 items). Instead, in most cases, an OverflowError is raised.
Éric Araujo [Mon, 29 Aug 2011 20:03:46 +0000 (22:03 +0200)]
Print all fields when calling “pysetup metadata” without options.
When called without option (“-f field” or “--all”), “pysetup metadata”
didn’t do anything useful. Now it prints out all metadata fields. The
“--all” option is removed.
Issue #12837: POSIX.1-2008 allows socklen_t to be a signed integer: re-enable
the check against negative values, and add a note on this surprising test.
Patch by David Watson.
Nadeem Vawda [Sun, 28 Aug 2011 09:29:35 +0000 (11:29 +0200)]
Merge: #12839: Fix crash in zlib module due to version mismatch.
If the version of zlib used to compile the zlib module is incompatible
with the one that is actually linked in, then calls into zlib will fail.
This can leave attributes of the z_stream uninitialized, so we must take
care to avoid segfaulting by trying to use an invalid pointer.
Nadeem Vawda [Sun, 28 Aug 2011 09:26:46 +0000 (11:26 +0200)]
Issue #12839: Fix crash in zlib module due to version mismatch.
If the version of zlib used to compile the zlib module is incompatible
with the one that is actually linked in, then calls into zlib will fail.
This can leave attributes of the z_stream uninitialized, so we must take
care to avoid segfaulting by trying to use an invalid pointer.
Nick Coghlan [Sat, 27 Aug 2011 14:17:31 +0000 (00:17 +1000)]
Fix #9923: mailcap now uses the OS path separator for the MAILCAP envvar. Not backported, since it could break cases where people worked around the old POSIX-specific behaviour on non-POSIX platforms.
Nadeem Vawda [Sat, 27 Aug 2011 13:24:23 +0000 (15:24 +0200)]
Merge: Make regrtest complain when -M and -j are used together.
-j doesn't pass the memlimit on to child processes, so this doesn't work at
present, and even if it did, running multiple bigmem tests at once would
usually not be desirable (since you generally want to devote as much of the
available RAM as possible to each test).
Nadeem Vawda [Sat, 27 Aug 2011 13:22:05 +0000 (15:22 +0200)]
Make regrtest complain when -M and -j are used together.
-j doesn't pass the memlimit on to child processes, so this doesn't work at
present, and even if it did, running multiple bigmem tests at once would
usually not be desirable (since you generally want to devote as much of the
available RAM as possible to each test).
Éric Araujo [Tue, 23 Aug 2011 23:29:10 +0000 (01:29 +0200)]
Fix distutils tests on Windows (#12678).
- First, support.fixup_build_ext (already used to set proper
library_dirs value under Unix shared builds) gains the ability to
correctly set the debug attribute under Windows debug builds.
- Second, the filename for the extension module gets a _d suffix under
debug builds.
- Third, the test code properly puts our customized build_ext object
into an internal dictionary to make sure that the install command will
later use our object instead of re-creating one. That’s the downside
of using low-level APIs in our test code: we have to manually push
knobs and turn handles that would otherwise be handled behind the
scenes.
Nick Coghlan [Tue, 23 Aug 2011 12:26:44 +0000 (22:26 +1000)]
Remove the SSLSocket versions of sendmsg/recvmsg due to lack of proper tests and documentation in conjunction with lack of any known use cases (see issue #6560 for details)
Ezio Melotti [Mon, 22 Aug 2011 17:03:25 +0000 (20:03 +0300)]
#10542: Add 4 macros to work with surrogates: Py_UNICODE_IS_SURROGATE, Py_UNICODE_IS_HIGH_SURROGATE, Py_UNICODE_IS_LOW_SURROGATE, Py_UNICODE_JOIN_SURROGATES.