From: Ezio Melotti Date: Mon, 26 Nov 2012 17:27:02 +0000 (+0200) Subject: #16559: merge with 3.2. X-Git-Tag: v3.3.1rc1~594 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c48303404858b06411ddadf8db5f3376aa52772d;p=python #16559: merge with 3.2. --- c48303404858b06411ddadf8db5f3376aa52772d diff --cc Misc/NEWS index b2e41dda92,b04986b404..62193b9cd6 --- a/Misc/NEWS +++ b/Misc/NEWS @@@ -196,109 -284,467 +196,112 @@@ Librar - Issue #16112: platform.architecture does not correctly escape argument to /usr/bin/file. Patch by David Benjamin. -- Issue #12776,#11839: call argparse type function (specified by add_argument) - only once. Before, the type function was called twice in the case where the - default was specified and the argument was given as well. This was - especially problematic for the FileType type, as a default file would always - be opened, even if a file argument was specified on the command line. +- Issue #15756: `subprocess.poll()` now properly handles `errno.ECHILD` to + return a returncode of 0 when the child has already exited or cannot be waited + on. -- Issue #15906: Fix a regression in argparse caused by the preceding change, - when action='append', type='str' and default=[]. +- Issue #15323: Improve failure message of `Mock.assert_called_once_with()`. -- Issue #13370: Ensure that ctypes works on Mac OS X when Python is - compiled using the clang compiler +- Issue #16064: ``unittest -m`` claims executable is "python", not "python3". -- Issue #15544: Fix Decimal.__float__ to work with payload-carrying NaNs. - -- Issue #15249: BytesGenerator now correctly mangles From lines (when - requested) even if the body contains undecodable bytes. - -- Issue #15777: Fix a refleak in _posixsubprocess. - -- Issue #15199: Fix JavaScript's default MIME type to application/javascript. - Patch by Bohuslav Kabrda. +- Issue #12376: Pass on parameters in `TextTestResult.__init__()` super call. -- Issue #13579: string.Formatter now understands the 'a' conversion specifier. +- Issue #15222: Insert blank line after each message in mbox mailboxes. -- Issue #15793: Stack corruption in ssl.RAND_egd(). +- Issue #16013: Fix `csv.Reader` parsing issue with ending quote characters. Patch by Serhiy Storchaka. -- Issue #15595: Fix subprocess.Popen(universal_newlines=True) - for certain locales (utf-16 and utf-32 family). Patch by Chris Jerdonek. +- Issue #15421: Fix an OverflowError in `Calendar.itermonthdates()` after + `datetime.MAXYEAR`. Patch by Cédric Krier. -- Issue #15477: In cmath and math modules, add workaround for platforms whose - system-supplied log1p function doesn't respect signs of zeros. - -- Issue #11062: Fix adding a message from file to Babyl mailbox. - -- Issue #15646: Prevent equivalent of a fork bomb when using - multiprocessing on Windows without the "if __name__ == '__main__'" - idiom. - -- Issue #15424: Add a __sizeof__ implementation for array objects. - Patch by Ludwig Hähne. - -- Issue #13052: Fix IDLE crashing when replace string in Search/Replace dialog - ended with '\'. Patch by Roger Serwy. - -- Issue #15538: Fix compilation of the getnameinfo() / getaddrinfo() - emulation code. Patch by Philipp Hagemeister. - -- Issue #9803: Don't close IDLE on saving if breakpoint is open. - Patch by Roger Serwy. +- Issue #15970: `xml.etree.ElementTree` now serializes correctly the empty HTML + elements 'meta' and 'param'. -- Issue #12288: Consider '0' and '0.0' as valid initialvalue - for tkinter SimpleDialog. +- Issue #15842: The `SocketIO.{readable,writable,seekable}` methods now raise + ValueError when the file-like object is closed. Patch by Alessandro Moura. -- Issue #15512: Add a __sizeof__ implementation for parser. - Patch by Serhiy Storchaka. +- Issue #15876: Fix a refleak in the `curses` module: window.encoding. -- Issue #15469: Add a __sizeof__ implementation for deque objects. - Patch by Serhiy Storchaka. +- Issue #15881: Fix `atexit` hook in `multiprocessing`. Original patch by Chris + McDonough. -- Issue #15489: Add a __sizeof__ implementation for BytesIO objects. - Patch by Serhiy Storchaka. +- Issue #15841: The readable(), writable() and seekable() methods of + `io.BytesIO` and `io.StringIO` objects now raise ValueError when the object + has been closed. Patch by Alessandro Moura. -- Issue #15487: Add a __sizeof__ implementation for buffered I/O objects. +- Issue #16126: PyErr_Format format mismatch in _testcapimodule.c. Patch by Serhiy Storchaka. -- Issue #6056: Make multiprocessing use setblocking(True) on the - sockets it uses. Original patch by J Derek Wilson. - -- Issue #15041: update "see also" list in tkinter documentation. - -- Issue #15402: An issue in the struct module that caused sys.getsizeof to - return incorrect results for struct.Struct instances has been fixed. - Initial patch by Serhiy Storchaka. - -- Issue #15232: when mangle_from is True, email.Generator now correctly mangles - lines that start with 'From ' that occur in a MIME preamble or epilogue. - -- Issue #13922: argparse no longer incorrectly strips '--'s that appear - after the first one. - -- Issue #12353: argparse now correctly handles null argument values. - -- Issues #10017 and #14998: Fix TypeError using pprint on dictionaries with - user-defined types as keys or other unorderable keys. - -- Issue #14635: telnetlib will use poll() rather than select() when possible - to avoid failing due to the select() file descriptor limit. - -- Issue #15180: Clarify posixpath.join() error message when mixing str & bytes - -- Issue #15230: runpy.run_path now correctly sets __package__ as described - in the documentation - -- Issue #14990: Correctly fail with SyntaxError on invalid encoding - declaration. - -- Issue #15247: FileIO now raises an error when given a file descriptor - pointing to a directory. - -- Issue #5346: Preserve permissions of mbox, MMDF and Babyl mailbox - files on flush(). - -- Issue #10571: Fix the "--sign" option of distutils' upload command. - Patch by Jakub Wilk. - -- Issue #9559: If messages were only added, a new file is no longer - created and renamed over the old file when flush() is called on an - mbox, MMDF or Babyl mailbox. - -- Issue #14653: email.utils.mktime_tz() no longer relies on system - mktime() when timezone offest is supplied. - -- Fix GzipFile's handling of filenames given as bytes objects. - -- Issue #15101: Make pool finalizer avoid joining current thread. - -- Issue #15036: Mailbox no longer throws an error if a flush is done - between operations when removing or changing multiple items in mbox, - MMDF, or Babyl mailboxes. - -- Issue #10133: Make multiprocessing deallocate buffer if socket read - fails. Patch by Hallvard B Furuseth. - -- Issue #13854: Make multiprocessing properly handle non-integer - non-string argument to SystemExit. - -- Issue #12157: Make pool.map() empty iterables correctly. Initial - patch by mouad. - -- Issue #14992: os.makedirs(path, exist_ok=True) would raise an OSError - when the path existed and had the S_ISGID mode bit set when it was - not explicitly asked for. This is no longer an exception as mkdir - cannot control if the OS sets that bit for it or not. - -- Issue #14962: Update text coloring in IDLE shell window after changing - options. Patch by Roger Serwy. +- Issue #15447: Use `subprocess.DEVNULL` in webbrowser, instead of opening + `os.devnull` explicitly and leaving it open. -- Issue #10997: Prevent a duplicate entry in IDLE's "Recent Files" menu. +- Issue #15509: `webbrowser.UnixBrowser` no longer passes empty arguments to + Popen when ``%action`` substitutions produce empty strings. -- Issue #14443: Tell rpmbuild to use the correct version of Python in - bdist_rpm. Initial patch by Ross Lagerwall. +- Issue #12776, issue #11839: Call `argparse` type function (specified by + add_argument) only once. Before, the type function was called twice in the + case where the default was specified and the argument was given as well. This + was especially problematic for the FileType type, as a default file would + always be opened, even if a file argument was specified on the command line. -- Issue #14929: Stop Idle 3.x from closing on Unicode decode errors when - grepping. Patch by Roger Serwy. +- Issue #15906: Fix a regression in `argparse` caused by the preceding change, + when ``action='append'``, ``type='str'`` and ``default=[]``. -- Issue #12510: Attempting to get invalid tooltip no longer closes Idle. - Other tooltipss have been corrected or improved and the number of tests - has been tripled. Original patch by Roger Serwy. +Tests +----- -- Issue #10365: File open dialog now works instead of crashing even when - the parent window is closed before the dialog. Patch by Roger Serwy. ++- Issue #16559: Add more tests for the json module, including some from the ++ official test suite at json.org. Patch by Serhiy Storchaka. + -- Issue #14876: Use user-selected font for highlight configuration. +- Issue #16115: Add some tests for the executable argument to + subprocess.Popen(). Initial patch by Kushal Das. -- Issue #14920: Fix the help(urllib.parse) failure on locale C on terminals. - Have ascii characters in help. +- Issue #15304: Fix warning message when `os.chdir()` fails inside + `test.support.temp_cwd()`. Patch by Chris Jerdonek. -- Issue #14863: Update the documentation of os.fdopen() to reflect the - fact that it's only a thin wrapper around open() anymore. +- Issue #15802: Fix test logic in `TestMaildir.test_create_tmp()`. Patch by + Serhiy Storchaka. -- Issue #14036: Add an additional check to validate that port in urlparse does - not go in illegal range and returns None. +- Issue #15557: Add a test suite for the `webbrowser` module, thanks to Anton + Barkovsky. -- Issue #14875: Use float('inf') instead of float('1e66666') in the json module. +Build +----- -- Issue #14426: Correct the Date format in Expires attribute of Set-Cookie - Header in Cookie.py. +- Issue #16262: fix out-of-src-tree builds, if mercurial is not installed. -- Issue #14721: Send the correct 'Content-length: 0' header when the body is an - empty string ''. Initial Patch contributed by Arve Knudsen. +- Issue #15298: ensure _sysconfigdata is generated in build directory, not + source directory. -- Issue #14072: Fix parsing of 'tel' URIs in urlparse by making the check for - ports stricter. +- Issue #15833: Fix a regression in 3.3 that resulted in exceptions being + raised if importlib failed to write byte-compiled files. This affected + attempts to build Python out-of-tree from a read-only source directory. -- Issue #9374: Generic parsing of query and fragment portions of url for any - scheme. Supported both by RFC3986 and RFC2396. +- Issue #15923: Fix a mistake in ``asdl_c.py`` that resulted in a TypeError + after 2801bf875a24 (see #15801). -- Issue #14798: Fix the functions in pyclbr to raise an ImportError - when the first part of a dotted name is not a package. Patch by - Xavier de Gaye. +- Issue #15819: Make sure we can build Python out-of-tree from a read-only + source directory. (Somewhat related to issue #9860.) -- Issue #14829: Fix bisect and range() indexing with large indices - (>= 2 ** 32) under 64-bit Windows. +Tools/Demos +----------- -- Issue #14777: tkinter may return undecoded UTF-8 bytes as a string when - accessing the Tk clipboard. Modify clipboad_get() to first request type - UTF8_STRING when no specific type is requested in an X11 windowing - environment, falling back to the current default type STRING if that fails. - Original patch by Thomas Kluyver. +- Issue #13301: use ast.literal_eval() instead of eval() in Tools/i18n/msgfmt.py + Patch by Serhiy Storchaka. -- Issue #12541: Be lenient with quotes around Realm field of HTTP Basic - Authentation in urllib2. +Documentation +------------- -- Issue #14662: Prevent shutil failures on OS X when destination does not - support chflag operations. Patch by Hynek Schlawack. +- Issue #13538: Improve str() and object.__str__() documentation. -- Issue #14157: Fix time.strptime failing without a year on February 29th. - Patch by Hynek Schlawack. +- Issue #16489: Make it clearer that importlib.find_loader() requires any and + all packages to be separately imported. -- Issue #14768: os.path.expanduser('~/a') doesn't works correctly when HOME is '/'. +- Issue #16400: Update the description of which versions of a given package + PyPI displays. -- Issue #14741: Fix missing support for Ellipsis ('...') in parser module. - -- Issue #14697: Fix missing support for set displays and set comprehensions in - parser module. - -- Issue #14701: Fix missing support for 'raise ... from' in parser module. - -- Issue #13183: Fix pdb skipping frames after hitting a breakpoint and running - step. Patch by Xavier de Gaye. - -- Issue #14696: Fix parser module to understand 'nonlocal' declarations. - -- Issue #10941: Fix imaplib.Internaldate2tuple to produce correct result near - the DST transition. Patch by Joe Peterson. - -- Issue #9154: Fix parser module to understand function annotations. - -- Issue #14664: It is now possible to use @unittest.skip{If,Unless} on a - test class that doesn't inherit from TestCase (i.e. a mixin). - -- Issue #14160: TarFile.extractfile() failed to resolve symbolic links when - the links were not located in an archive subdirectory. - -- Issue #14638: pydoc now treats non-string __name__ values as if they - were missing, instead of raising an error. - -- Issue #13684: Fix httplib tunnel issue of infinite loops for certain sites - which send EOF without trailing \r\n. - -- Issue #14629: Raise SyntaxError in tokenizer.detect_encoding if the - first two lines have non-UTF-8 characters without an encoding declaration. - -- Issue #14308: Fix an exception when a "dummy" thread is in the threading - module's active list after a fork(). - -- Issue #14538: HTMLParser can now parse correctly start tags that contain - a bare '/'. - -- Issue #14452: SysLogHandler no longer inserts a UTF-8 BOM into the message. - -- Issue #13496: Fix potential overflow in bisect.bisect algorithm when applied - to a collection of size > sys.maxsize / 2. - -- Issue #14399: zipfile now recognizes that the archive has been modified even - if only the comment is changed. In addition, the TypeError that results from - trying to set a non-binary value as a comment is now now raised at the time - the comment is set rather than at the time the zipfile is written. - -- Issue #7978: socketserver now restarts the select() call when EINTR is - returned. This avoids crashing the server loop when a signal is received. - Patch by Jerzy Kozera. - -- Issue #14496: Fix wrong name in idlelib/tabbedpages.py. - Patch by Popa Claudiu. - -- Issue #14482: Raise a ValueError, not a NameError, when trying to create - a multiprocessing Client or Listener with an AF_UNIX type address under - Windows. Patch by Popa Claudiu. - -- Issue #14151: Raise a ValueError, not a NameError, when trying to create - a multiprocessing Client or Listener with an AF_PIPE type address under - non-Windows platforms. Patch by Popa Claudiu. - -- Issue #13872: socket.detach() now marks the socket closed (as mirrored - in the socket repr()). Patch by Matt Joiner. - -- Issue #14406: Fix a race condition when using ``concurrent.futures.wait( - return_when=ALL_COMPLETED)``. Patch by Matt Joiner. - -- Issue #14409: IDLE now properly executes commands in the Shell window - when it cannot read the normal config files on startup and - has to use the built-in default key bindings. - There was previously a bug in one of the defaults. - -- Issue #10340: asyncore - properly handle EINVAL in dispatcher constructor on - OSX; avoid to call handle_connect in case of a disconnected socket which - was not meant to connect. - -- Issue #12757: Fix the skipping of doctests when python is run with -OO so - that it works in unittest's verbose mode as well as non-verbose mode. - -- Issue #3573: IDLE hangs when passing invalid command line args - (directory(ies) instead of file(s)) (Patch by Guilherme Polo) - -- Issue #13694: asynchronous connect in asyncore.dispatcher does not set addr - attribute. - -- Issue #11686: Added missing entries to email package __all__ lists - (mostly the new Bytes classes). - -- Issue #10484: Fix the CGIHTTPServer's PATH_INFO handling problem. - -- Issue #11199: Fix the with urllib which hangs on particular ftp urls. - -- Issue #14062: Header objects now correctly respect the 'linesep' setting - when processed by BytesParser (which smtplib.SMTP.send_message uses). - -- Issue #14291: Email now defaults to utf-8 for non-ASCII unicode headers - instead of raising an error. This fixes a regression relative to 2.7. - -- Issue #5219: Prevent event handler cascade in IDLE. - -- Issue #14184: Increase the default stack size for secondary threads on - Mac OS X to avoid interpreter crashes when using threads on 10.7. - -- Issue #10543: Fix unittest test discovery with Jython bytecode files. - -- Issue #14252: Fix subprocess.Popen.terminate() to not raise an error under - Windows when the child process has already exited. - -- Issue #14195: An issue that caused weakref.WeakSet instances to incorrectly - return True for a WeakSet instance 'a' in both 'a < a' and 'a > a' has been - fixed. - -- Issue #14177: marshal.loads() now raises TypeError when given an unicode - string. Patch by Guilherme Gonçalves. - -- Issue #14159: Fix the len() of weak containers (WeakSet, WeakKeyDictionary, - WeakValueDictionary) to return a better approximation when some objects - are dead or dying. Moreover, the implementation is now O(1) rather than - O(n). - -- Issue #13125: Silence spurious test_lib2to3 output when in non-verbose mode. - Patch by Mikhail Novikov. - -- Issue #13447: Add a test file to host regression tests for bugs in the - scripts found in the Tools directory. - -- Issue #8033: sqlite3: Fix 64-bit integer handling in user functions - on 32-bit architectures. Initial patch by Philippe Devalkeneer. - -Extension Modules ------------------ - -- Issue #16012: Fix a regression in pyexpat. The parser's UseForeignDTD() - method doesn't require an argument again. - -- Issue #15676: Now "mmap" check for empty files before doing the - offset check. Patch by Steven Willis. - -- Issue #6493: An issue in ctypes on Windows that caused structure bitfields - of type ctypes.c_uint32 and width 32 to incorrectly be set has been fixed. - -- Issue #15000: Support the "unique" x32 architecture in _posixsubprocess.c. - -- Issue #9041: An issue in ctypes.c_longdouble, ctypes.c_double, and - ctypes.c_float that caused an incorrect exception to be returned in the - case of overflow has been fixed. - -- Issue #14212: The re module didn't retain a reference to buffers it was - scanning, resulting in segfaults. - -Tests ------ - -- Issue #16559: Add more tests for the json module, including some from the - official test suite at json.org. Patch by Serhiy Storchaka. - -- Issue #15304: Fix warning message when os.chdir() fails inside - test.support.temp_cwd(). Patch by Chris Jerdonek. - -- Issue #15802: Fix test logic in TestMaildir.test_create_tmp. Patch - by Serhiy Storchaka. - -- Issue #15747: ZFS always returns EOPNOTSUPP when attempting to set the - UF_IMMUTABLE flag (via either chflags or lchflags); refactor affected - tests in test_posix.py to account for this. - -- Issue #15285: Refactor the approach for testing connect timeouts using - two external hosts that have been configured specifically for this type - of test. - -- Issue #15615: Add some tests for the json module's handling of invalid - input data. Patch by Kushal Das. - -- Issue #15496: Add directory removal helpers for tests on Windows. - Patch by Jeremy Kloth. - -- Issue #15467: Move helpers for __sizeof__ tests into test_support. - Patch by Serhiy Storchaka. - -- Issue #15320: Make iterating the list of tests thread-safe when running - tests in multiprocess mode. Patch by Chris Jerdonek. - -- Issue #15230: Adopted a more systematic approach in the runpy tests - -- Issue #15300: Ensure the temporary test working directories are in the same - parent folder when running tests in multiprocess mode from a Python build. - Patch by Chris Jerdonek. - -- test_nntplib now tolerates being run from behind NNTP gateways that add - "X-Antivirus" headers to articles - -- Issue #15043: test_gdb is now skipped entirely if gdb security settings - block loading of the gdb hooks - -- Issue #14026: In test_cmd_line_script, check that sys.argv is populated - correctly for the various invocation approaches (Patch by Jason Yeo) - -- Issue #14032: Fix incorrect variable name in test_cmd_line_script debugging - message (Patch by Jason Yeo) - -- Issue #14589: Update certificate chain for sha256.tbs-internet.com, fixing - a test failure in test_ssl. - -Build ------ - -- Issue #16262: fix out-of-src-tree builds, if mercurial is not installed. - -- Issue #15923: fix a mistake in asdl_c.py that resulted in a TypeError after - 2801bf875a24 (see #15801). - -- Issue #11715: Fix multiarch detection without having Debian development - tools (dpkg-dev) installed. - -- Issue #15819: Make sure we can build Python out-of-tree from a readonly - source directory. (Somewhat related to Issue #9860.) - -- Issue #15822: Ensure 2to3 grammar pickles are properly installed. - -- Issue #15560: Fix building _sqlite3 extension on OS X with an SDK. - -- Issue #8847: Disable COMDAT folding in Windows PGO builds. - -- Issue #14197: For OS X framework builds, ensure links to the shared - library are created with the proper ABI suffix. - -- Issue #14472: Update .gitignore. Patch by Matej Cepl. - -- The Windows build now uses OpenSSL 1.0.0j and bzip2 1.0.6. - -- Issue #14557: Fix extensions build on HP-UX. Patch by Adi Roiban. - -- Issue #14437: Fix building the _io module under Cygwin. - -- Issue #14387: Do not include accu.h from Python.h. - -- Issue #14359: Only use O_CLOEXEC in _posixmodule.c if it is defined. - Based on patch from Hervé Coatanhay. - -- Issue #14018: Fix OS X Tcl/Tk framework checking when using OS X SDKs. - -Tools/Demos ------------ - -- Issue #13301: use ast.literal_eval() instead of eval() in Tools/i18n/msgfmt.py - Patch by Serhiy Storchaka. - -Documentation -------------- - -- Issue #13538: Improve str() and object.__str__() documentation. - -- Issue #16400: Update the description of which versions of a given package - PyPI displays. - -- Issue #15677: Document that zlib and gzip accept a compression level of 0 to - mean 'no compression'. Patch by Brian Brazil. +- Issue #15677: Document that zlib and gzip accept a compression level of 0 to + mean 'no compression'. Patch by Brian Brazil. - Issue #8040: added a version switcher to the documentation. Patch by Yury Selivanov.