From: Victor Stinner Date: Mon, 3 Jun 2013 20:09:14 +0000 (+0200) Subject: (Merge 3.3) Close #18109: os.uname() now decodes fields from the locale X-Git-Tag: v3.4.0a1~580 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0b81111b18790e5d95cb84a09d15aadfb8a1dadf;p=python (Merge 3.3) Close #18109: os.uname() now decodes fields from the locale encoding, and socket.gethostname() now decodes the hostname from the locale encoding, instead of using the UTF-8 encoding in strict mode. --- 0b81111b18790e5d95cb84a09d15aadfb8a1dadf diff --cc Misc/NEWS index a90504f7be,15a91b2349..deeec0a8dc --- a/Misc/NEWS +++ b/Misc/NEWS @@@ -24,148 -15,135 +24,152 @@@ Core and Builtin - Issue #17644: Fix a crash in str.format when curly braces are used in square brackets. -- Issue #17983: Raise a SyntaxError for a ``global __class__`` statement in a - class body. +- Issue #17237: Fix crash in the ASCII decoder on m68k. -- Issue #17927: Frame objects kept arguments alive if they had been copied into - a cell, even if the cell was cleared. +- Issue #17927: Frame objects kept arguments alive if they had been + copied into a cell, even if the cell was cleared. -Library -------- +- Issue #1545463: At shutdown, defer finalization of codec modules so + that stderr remains usable. -- Issue #18109: os.uname() now decodes fields from the locale encoding, and - socket.gethostname() now decodes the hostname from the locale encoding, - instead of using the UTF-8 encoding in strict mode. +- Issue #7330: Implement width and precision (ex: "%5.3s") for the format + string of PyUnicode_FromFormat() function, original patch written by Ysj Ray. -- Issue #17403: urllib.parse.robotparser normalizes the urls before adding to - ruleline. This helps in handling certain types invalid urls in a conservative - manner. +- Issue #1545463: Global variables caught in reference cycles are now + garbage-collected at shutdown. -- Issue #18025: Fixed a segfault in io.BufferedIOBase.readinto() when raw - stream's read() returns more bytes than requested. +- Issue #17094: Clear stale thread states after fork(). Note that this + is a potentially disruptive change since it may release some system + resources which would otherwise remain perpetually alive (e.g. database + connections kept in thread-local storage). -- Issue #18011: base64.b32decode() now raises a binascii.Error if there are - non-alphabet characters present in the input string to conform a docstring. - Updated the module documentation. +- Issue #17408: Avoid using an obsolete instance of the copyreg module when + the interpreter is shutdown and then started again. -- Issue #13772: Restored directory detection of targets in ``os.symlink`` on - Windows, which was temporarily removed in Python 3.2.3 due to an incomplete - implementation. The implementation now works even if the symlink is created - in a location other than the current directory. +- Issue #5845: Enable tab-completion in the interactive interpreter by + default, thanks to a new sys.__interactivehook__. -- Issue #16986: ElementTree now correctly parses a string input not only when - an internal XML encoding is UTF-8 or US-ASCII. +- Issue #17115,17116: Module initialization now includes setting __package__ and + __loader__ attributes to None. -- Issue #17812: Fixed quadratic complexity of base64.b32encode(). +- Issue #17853: Ensure locals of a class that shadow free variables always win + over the closures. -- Issue #17980: Fix possible abuse of ssl.match_hostname() for denial of - service using certificates with many wildcards (CVE-2013-2099). +- Issue #17863: In the interactive console, don't loop forever if the encoding + can't be fetched from stdin. -- Issue #17981: Closed socket on error in SysLogHandler. +- Issue #17867: Raise an ImportError if __import__ is not found in __builtins__. -- Fix typos in the multiprocessing module. +- Issue #17857: Prevent build failures with pre-3.5.0 versions of sqlite3, + such as was shipped with Centos 5 and Mac OS X 10.4. -- Issue #17754: Make ctypes.util.find_library() independent of the locale. +- Issue #17413: sys.settrace callbacks were being passed a string instead of an + exception instance for the 'value' element of the arg tuple if the exception + originated from C code; now an exception instance is always provided. -- Issue #17968: Fix memory leak in os.listxattr(). +- Issue #17782: Fix undefined behaviour on platforms where + ``struct timespec``'s "tv_nsec" member is not a C long. -- Issue #17269: Workaround for socket.getaddrinfo crash on MacOS X - with port None or "0" and flags AI_NUMERICSERV. +- Issue #17722: When looking up __round__, resolve descriptors. -- Issue #18080: When building a C extension module on OS X, if the compiler - is overriden with the CC environment variable, use the new compiler as - the default for linking if LDSHARED is not also overriden. This restores - Distutils behavior introduced in 3.2.3 and inadvertently dropped in 3.3.0. +- Issue #16061: Speed up str.replace() for replacing 1-character strings. -IDLE ----- +- Issue #17715: Fix segmentation fault from raising an exception in a __trunc__ + method. -- Issue #15392: Create a unittest framework for IDLE. - Initial patch by Rajagopalasarma Jayakrishnan. +- Issue #17643: Add __callback__ attribute to weakref.ref. -- Issue #14146: Highlight source line while debugging on Windows. +- Issue #16447: Fixed potential segmentation fault when setting __name__ on a + class. -- Issue #17532: Always include Options menu for IDLE on OS X. - Patch by Guilherme Simões. +- Issue #17669: Fix crash involving finalization of generators using yield from. -Tests ------ +- Issue #14439: Python now prints the traceback on runpy failure at startup. -- Issue #18094: test_uuid no more reports skipped tests as passed. -- Issue #11995: test_pydoc doesn't import all sys.path modules anymore. +- Issue #17469: Fix _Py_GetAllocatedBlocks() and sys.getallocatedblocks() + when running on valgrind. -Documentation -------------- +- Issue #17619: Make input() check for Ctrl-C correctly on Windows. -- Issue #17953: Mention that you shouldn't replace sys.modules and deleting key - items will cause Python to not be happy. +- Issue #17357: Add missing verbosity messages for -v/-vv that were lost during + the importlib transition. -- Issue #17844: Add links to encoders and decoders for bytes-to-bytes codecs. +- Issue #17610: Don't rely on non-standard behavior of the C qsort() function. -- Issue #14097: improve the "introduction" page of the tutorial. +- Issue #17323: The "[X refs, Y blocks]" printed by debug builds has been + disabled by default. It can be re-enabled with the `-X showrefcount` option. -- Issue #17977: The documentation for the cadefault argument's default value - in urllib.request.urlopen() is fixed to match the code. +Library +------- ++- Issue #18109: os.uname() now decodes fields from the locale encoding, and ++ socket.gethostname() now decodes the hostname from the locale encoding, ++ instead of using the UTF-8 encoding in strict mode. + -What's New in Python 3.3.2? -=========================== +- Issue #18089: Implement importlib.abc.InspectLoader.load_module. -*Release date: 13-May-2013* +- Issue #18088: Introduce importlib.abc.Loader.init_module_attrs for setting + module attributes. Leads to the pending deprecation of + importlib.util.module_for_loader. -Core and Builtins ------------------ +- Issue #17403: urllib.parse.robotparser normalizes the urls before adding to + ruleline. This helps in handling certain types invalid urls in a conservative + manner. Patch contributed by Mher Movsisyan. -- Issue #17237: Fix crash in the ASCII decoder on m68k. +- Issue #18070: Have importlib.util.module_for_loader() set attributes + unconditionally in order to properly support reloading. -- Issue #17408: Avoid using an obsolete instance of the copyreg module when - the interpreter is shutdown and then started again. +- Added importlib.util.module_to_load to return a context manager to provide the + proper module object to load. -- Issue #17863: In the interactive console, don't loop forever if the encoding - can't be fetched from stdin. +- Issue #18025: Fixed a segfault in io.BufferedIOBase.readinto() when raw + stream's read() returns more bytes than requested. -- Issue #17867: Raise an ImportError if __import__ is not found in __builtins__. +- Issue #18011: base64.b32decode() now raises a binascii.Error if there are + non-alphabet characters present in the input string to conform a docstring. + Updated the module documentation. -- Issue #17857: Prevent build failures with pre-3.5.0 versions of sqlite3, - such as was shipped with Centos 5 and Mac OS X 10.4. +- Issue #18072: Implement importlib.abc.InspectLoader.get_code() and + importlib.abc.ExecutionLoader.get_code(). -- Issue #17413: sys.settrace callbacks were being passed a string instead of an - exception instance for the 'value' element of the arg tuple if the exception - originated from C code; now an exception instance is always provided. +- Issue #8240: Set the SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER flag on SSL + sockets. -- Issue #17782: Fix undefined behaviour on platforms where - ``struct timespec``'s "tv_nsec" member is not a C long. +- Issue #17269: Workaround for socket.getaddrinfo crash on MacOS X + with port None or "0" and flags AI_NUMERICSERV. -- Issue #17715: Fix segmentation fault from raising an exception in a __trunc__ - method. +- Issue #16986: ElementTree now correctly parses a string input not only when + an internal XML encoding is UTF-8 or US-ASCII. -- Issue #16447: Fixed potential segmentation fault when setting __name__ on a - class. +- Issue #17996: socket module now exposes AF_LINK constant on BSD and OSX. -- Issue #17669: Fix crash involving finalization of generators using yield from. +- Issue #17900: Allowed pickling of recursive OrderedDicts. Decreased pickled + size and pickling time. -- Issue #17619: Make input() check for Ctrl-C correctly on Windows. +- Issue #17914: Add os.cpu_count(). Patch by Yogesh Chaudhari, based on an + initial patch by Trent Nelson. -- Issue #17610: Don't rely on non-standard behavior of the C qsort() function. +- Issue #17812: Fixed quadratic complexity of base64.b32encode(). + Optimize base64.b32encode() and base64.b32decode() (speed up to 3x). -- Issue #17357: Add missing verbosity output when using -v/-vv. +- Issue #17980: Fix possible abuse of ssl.match_hostname() for denial of + service using certificates with many wildcards (CVE-2013-2099). -Library -------- +- Issue #15758: Fix FileIO.readall() so it no longer has O(n**2) complexity. + +- Issue #14596: The struct.Struct() objects now use more compact implementation. + +- Issue #17981: Closed socket on error in SysLogHandler. + +- Issue #17964: Fix os.sysconf(): the return type of the C sysconf() function + is long, not int. + +- Fix typos in the multiprocessing module. + +- Issue #17754: Make ctypes.util.find_library() independent of the locale. + +- Issue #17968: Fix memory leak in os.listxattr(). - Issue #17606: Fixed support of encoded byte strings in the XMLGenerator characters() and ignorableWhitespace() methods. Original patch by Sebastian @@@ -391,50 -337,32 +395,50 @@@ Documentatio - Issue #6696: add documentation for the Profile objects, and improve profile/cProfile docs. Patch by Tom Pinckney. -- Issue #17915: Fix interoperability of xml.sax with file objects returned by - codecs.open(). +Tests +----- -Build +- Issue #11995: test_pydoc doesn't import all sys.path modules anymore. + +C-API ----- -- Issue #17547: In configure, explicitly pass -Wformat for the benefit for GCC - 4.8. +- Issue #9369: The types of `char*` arguments of PyObject_CallFunction() and + PyObject_CallMethod() now changed to `const char*`. Based on patches by + Jörg Müller and Lars Buitinck. -- Issue #17962: Build with OpenSSL 1.0.1e on Windows. +- Issue #17206: Py_CLEAR(), Py_DECREF(), Py_XINCREF() and Py_XDECREF() now + expand their arguments once instead of multiple times. Patch written by Illia + Polosukhin. +- Issue #17522: Add the PyGILState_Check() API. -What's New in Python 3.3.1? -=========================== +- Issue #17327: Add PyDict_SetDefault. -*Release date: 07-Apr-2013* +IDLE +---- -Build ------ +- Issue #15392: Create a unittest framework for IDLE. + Initial patch by Rajagopalasarma Jayakrishnan. - + -- Issue #17550: Fix the --enable-profiling configure switch. +- Issue #14146: Highlight source line while debugging on Windows. -IDLE -------- +- Issue #17838: Allow sys.stdin to be reassigned. -- Issue #17625: In IDLE, close the replace dialog after it is used. +- Issue #13495: Avoid loading the color delegator twice in IDLE. + +- Issue #17798: Allow IDLE to edit new files when specified on command line. + +- Issue #14735: Update IDLE docs to omit "Control-z on Windows". + +- Issue #17532: Always include Options menu for IDLE on OS X. + Patch by Guilherme Simões. + +Build +----- + +- Issue #17547: In configure, explicitly pass -Wformat for the benefit for GCC + 4.8. What's New in Python 3.3.1 release candidate 1?