Victor Stinner [Fri, 10 Sep 2010 23:49:04 +0000 (23:49 +0000)]
Issue #9579, #9580: Fix os.confstr() for value longer than 255 bytes and encode
the value with filesystem encoding and surrogateescape (instead of utf-8 in
strict mode).
Victor Stinner [Fri, 10 Sep 2010 21:57:59 +0000 (21:57 +0000)]
Issue #9632: Remove sys.setfilesystemencoding() function: use PYTHONFSENCODING
environment variable to set the filesystem encoding at Python startup.
sys.setfilesystemencoding() creates inconsistencies because it is unable to
reencode all filenames in all objects.
#4617: Previously it was illegal to delete a name from the local
namespace if it occurs as a free variable in a nested block. This limitation
of the compiler has been lifted, and a new opcode introduced (DELETE_DEREF).
This sample was valid in 2.6, but fails to compile in 3.x without this change::
Antoine Pitrou [Thu, 9 Sep 2010 20:30:23 +0000 (20:30 +0000)]
Issue #9804: ascii() now always represents unicode surrogate pairs as
a single `\UXXXXXXXX`, regardless of whether the character is printable
or not. Also, the "backslashreplace" error handler now joins surrogate
pairs into a single character on UCS-2 builds.
Antoine Pitrou [Thu, 9 Sep 2010 18:33:21 +0000 (18:33 +0000)]
Issue #9410: Various optimizations to the pickle module, leading to
speedups up to 4x (depending on the benchmark). Mostly ported from
Unladen Swallow; initial patch by Alexandre Vassalotti.
Antoine Pitrou [Thu, 9 Sep 2010 12:59:39 +0000 (12:59 +0000)]
Issue #9757: memoryview objects get a release() method to release the
underlying buffer (previously this was only done when deallocating the
memoryview), and gain support for the context management protocol.
PCBuild cosmetic fixes.
* pythoncore.vcproj: Fixed indentation
* _multiprocessing.vcproj: Converted ProjectGUID to uppercase. Otherwise,
VS8 _multiprocessing.vcproj created by vs9to8.py was modified every time
loads it in VS8 IDE.
Antoine Pitrou [Wed, 8 Sep 2010 20:57:48 +0000 (20:57 +0000)]
Issue #9188: The gdb extension now handles correctly narrow (UCS2) as well
as wide (UCS4) unicode builds for both the host interpreter (embedded
inside gdb) and the interpreter under test.
* Remove dependency on binascii.hexlify by using int.from_bytes().
* Use the new super() with no arguments.
* Replace pow() call with the ** operator.
* Increase urandom seeding from 16 bytes to 32 bytes.
* Clean-up docstring.
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.