Antoine Pitrou [Tue, 7 Sep 2010 22:06:17 +0000 (22:06 +0000)]
Issue #9707: Rewritten reference implementation of threading.local which
is friendlier towards reference cycles. This change is not normally
visible since an optimized C implementation (_thread._local) is used
instead.
Antoine Pitrou [Tue, 7 Sep 2010 21:05:49 +0000 (21:05 +0000)]
Issue #9792: In case of connection failure, socket.create_connection()
would swallow the exception and raise a new one, making it impossible
to fetch the original errno, or to filter timeout errors. Now the
original error is re-raised.
Antoine Pitrou [Tue, 7 Sep 2010 18:44:12 +0000 (18:44 +0000)]
Update nntplib examples to use a public news server.
The example still doesn't work as-is under py3k, due to incomplete
or buggy porting of the nntplib module.
Antoine Pitrou [Tue, 7 Sep 2010 16:30:09 +0000 (16:30 +0000)]
Issue #9758: When fcntl.ioctl() was called with mutable_flag set to True,
and the passed buffer was exactly 1024 bytes long, the buffer wouldn't
be updated back after the system call. Original patch by Brian Brazil.
Brian Curtin [Mon, 6 Sep 2010 19:46:17 +0000 (19:46 +0000)]
Fix some errors that #7566 introduced on non-Windows platforms due to
an ImportError. Rearranged the import, faked out the implementation when
the import fails, and reorganized a test that depends on Win32 behavior.
Antoine Pitrou [Mon, 6 Sep 2010 19:25:46 +0000 (19:25 +0000)]
Issue #9754: Similarly to assertRaises and assertRaisesRegexp, unittest
test cases now also have assertWarns and assertWarnsRegexp methods to
check that a given warning type was triggered by the code under test.
Antoine Pitrou [Mon, 6 Sep 2010 18:48:21 +0000 (18:48 +0000)]
Issue #5506: BytesIO objects now have a getbuffer() method exporting a
view of their contents without duplicating them. The view is both readable
and writable.
Brian Curtin [Mon, 6 Sep 2010 17:07:27 +0000 (17:07 +0000)]
Implement #7566 - os.path.sameopenfile for Windows.
This uses the GetFileInformationByHandle function to return a tuple of values
to identify a file, then ntpath.sameopenfile compares file tuples, which
is exposed as os.path.sameopenfile.
hashlib has two new constant attributes: algorithms_guaranteed and
algorithms_avaiable that respectively list the names of hash algorithms
guaranteed to exist in all Python implementations and the names of hash
algorithms available in the current process.
Renames the attribute new in 3.2a0 'algorithms' to 'algorithms_guaranteed'.
Antoine Pitrou [Sun, 5 Sep 2010 23:01:12 +0000 (23:01 +0000)]
Issue #9293: I/O streams now raise `io.UnsupportedOperation` when an
unsupported operation is attempted (for example, writing to a file open
only for reading).
- The entry about shutil.copytree is just a revert of r84524 which
looks like an unfinished edition.
- The use of gender-neutral language (s/his/their/) removes the
implicit assumption that programmer == male (change agreed by Antoine).
- Other changes should be uncontroversial fixes.
I haven’t rewrapped under 80 lines to keep the diffs readable; I’ll
rewrap later.
Antoine Pitrou [Sat, 4 Sep 2010 20:16:53 +0000 (20:16 +0000)]
Issue #7451: Improve decoding performance of JSON objects, and reduce
the memory consumption of said decoded objects when they use the same
strings as keys.
Antoine Pitrou [Sat, 4 Sep 2010 18:43:52 +0000 (18:43 +0000)]
Issue #9225: Remove the ROT_FOUR and DUP_TOPX opcode, the latter replaced
by the new (and simpler) DUP_TOP_TWO. Performance isn't changed, but
our bytecode is a bit simplified. Patch by Demur Rumed.
_warnings exposed two variables with the name 'default_action' and
'once_registry'. This is bad as the warnings module had variables named
'defaultaction' and 'onceregistry' which are what people should be looking at
(technically those variables shouldn't be mucked with as they are undocumented,
but we all know better than to believe that isn't happening). So the variables
from _warnings have been renamed to come off as private and to avoid confusion
over what variable should be used.
Closes issue #9766. Thanks to Antoine Pitrou for the discovery.