Gregory P. Smith [Tue, 11 Dec 2012 02:34:09 +0000 (18:34 -0800)]
Keep y a Py_hash_t instead of Py_uhash_t as it is compared with == -1 and the
compiler logic will do the right thing with just x as a Py_uhash_t. This
matches what was already done in the 3.3 version.
cleanup only - no functionality or hash values change.
Gregory P. Smith [Tue, 11 Dec 2012 02:15:46 +0000 (18:15 -0800)]
Fix the internals of our hash functions to used unsigned values during hash
computation as the overflow behavior of signed integers is undefined.
In practice we require compiling everything with -fwrapv which forces overflow
to be defined as twos compliment but this keeps the code cleaner for checkers
or in the case where someone has compiled it without -fwrapv or their
compiler's equivalent.
Found by Clang trunk's Undefined Behavior Sanitizer (UBSan).
Cleanup only - no functionality or hash values change.
Antoine Pitrou [Sat, 8 Dec 2012 20:15:26 +0000 (21:15 +0100)]
Issue #16602: When a weakref's target was part of a long deallocation chain, the object could remain reachable through its weakref even though its refcount had dropped to zero.
Thanks to Eugene Toder for diagnosing and reporting the issue.
Éric Araujo [Sat, 8 Dec 2012 19:51:47 +0000 (14:51 -0500)]
Create ~/.pypirc securely (#13512).
There was a window between the write and the chmod where the user’s
password would be exposed, depending on default permissions. Philip
Jenvey’s patch fixes it.
Éric Araujo [Sat, 8 Dec 2012 19:21:51 +0000 (14:21 -0500)]
Ignore .nfs* files in distutils (#7719).
These files are created by some NFS clients a file is edited and removed
concurrently (see added link in doc for more info). If such a file is
removed between distutils calls listdir and copy, it will get confused.
Other special files are ignored in sdist (namely VCS directories), but
this has to be filtered out earlier.
Victor Stinner [Mon, 3 Dec 2012 11:47:59 +0000 (12:47 +0100)]
Issue #16416: On Mac OS X, operating system data are now always
encoded/decoded to/from UTF-8/surrogateescape, instead of the locale encoding
(which may be ASCII if no locale environment variable is set), to avoid
inconsistencies with os.fsencode() and os.fsdecode() functions which are
already using UTF-8/surrogateescape.
This commit adds "parameter" to the glossary, improves and consolidates the
"argument" glossary entry, and adds a question to the FAQ on the difference
between arguments and parameters.
Gregory P. Smith [Tue, 27 Nov 2012 18:16:55 +0000 (10:16 -0800)]
Plug a leak in timemodule. The module dictionary is saved during
initialization. If the interpreter is shut down and reinitialized (embedded
CPython), the old module dictionary was not dec-refed during the next import of
the time extension module.
Antoine Pitrou [Sat, 24 Nov 2012 19:40:21 +0000 (20:40 +0100)]
Issue #12848: The pure Python pickle implementation now treats object lengths as unsigned 32-bit integers, like the C implementation does.
Patch by Serhiy Storchaka.
Gregory P. Smith [Sun, 11 Nov 2012 09:37:02 +0000 (01:37 -0800)]
Fixes issue #16140: The subprocess module no longer double closes its
child subprocess.PIPE parent file descriptors on child error prior to
exec().
This would lead to race conditions in multithreaded programs where
another thread opened a file reusing the fd which was then closed out
from beneath it by the errant second close.
Gregory P. Smith [Sun, 11 Nov 2012 08:04:13 +0000 (00:04 -0800)]
Remove the subprocess "bad exception data" warning (formerly a print!)
all together and just include the repr of the data in the exception
itself instead of the useless string "Unknown".
This code path is unlikely to even be possible to take given the
nature of the pipe it gets subprocess data from.
Gregory P. Smith [Sun, 11 Nov 2012 07:33:17 +0000 (23:33 -0800)]
Rename a local variable for readability and change a "this can't
happen" print() call into a RuntimeWarning as it should've been in the
first place. Because nothing should ever cause unexpected stdout output.
Nadeem Vawda [Sun, 11 Nov 2012 01:14:36 +0000 (02:14 +0100)]
Issue #16350, part 2: Set unused_data (and unconsumed_tail) correctly in decompressobj().flush().
Additionally, fix a bug where a MemoryError in allocating a bytes object could
leave the decompressor object in an invalid state (with its unconsumed_tail
member being NULL).