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.
Fred Drake [Fri, 3 Sep 2010 04:22:36 +0000 (04:22 +0000)]
fix output from RawConfigParser.write and ConfigParser.write for None
values (http://bugs.python.org/issue7005)
(merged r84443 from the release27-mmaint branch, with changes to reflect
changes in Python 3)
Issue #9212: Added the missing isdisjoint method to the dict_keys and
dict_items views. The method is required by the collections.Set ABC,
which the views register as supporting.