]> granicus.if.org Git - python/commitdiff
Issue #15677: Document that zlib and gzip accept a compression level of 0 to mean...
authorNadeem Vawda <nadeem.vawda@gmail.com>
Sun, 11 Nov 2012 13:14:47 +0000 (14:14 +0100)
committerNadeem Vawda <nadeem.vawda@gmail.com>
Sun, 11 Nov 2012 13:14:47 +0000 (14:14 +0100)
Patch by Brian Brazil.

1  2 
Doc/library/gzip.rst
Doc/library/zlib.rst
Lib/gzip.py
Misc/NEWS
Modules/zlibmodule.c

index 50d04627e777069d0fcd3acf22c93cd5e928498f,abbd018ca27dc087e4088daf36884da79f7a3f92..2cbd2d5f5ba7eccb0f855e16521481f11baf889f
@@@ -26,34 -24,6 +26,34 @@@ Note that additional file formats whic
  The module defines the following items:
  
  
-    The *compresslevel* argument is an integer from 1 to 9, as for the
 +.. function:: open(filename, mode='rb', compresslevel=9, encoding=None, errors=None, newline=None)
 +
 +   Open a gzip-compressed file in binary or text mode, returning a :term:`file
 +   object`.
 +
 +   The *filename* argument can be an actual filename (a :class:`str` or
 +   :class:`bytes` object), or an existing file object to read from or write to.
 +
 +   The *mode* argument can be any of ``'r'``, ``'rb'``, ``'a'``, ``'ab'``,
 +   ``'w'``, or ``'wb'`` for binary mode, or ``'rt'``, ``'at'``, or ``'wt'`` for
 +   text mode. The default is ``'rb'``.
 +
++   The *compresslevel* argument is an integer from 0 to 9, as for the
 +   :class:`GzipFile` constructor.
 +
 +   For binary mode, this function is equivalent to the :class:`GzipFile`
 +   constructor: ``GzipFile(filename, mode, compresslevel)``. In this case, the
 +   *encoding*, *errors* and *newline* arguments must not be provided.
 +
 +   For text mode, a :class:`GzipFile` object is created, and wrapped in an
 +   :class:`io.TextIOWrapper` instance with the specified encoding, error
 +   handling behavior, and line ending(s).
 +
 +   .. versionchanged:: 3.3
 +      Added support for *filename* being a file object, support for text mode,
 +      and the *encoding*, *errors* and *newline* arguments.
 +
 +
  .. class:: GzipFile(filename=None, mode=None, compresslevel=9, fileobj=None, mtime=None)
  
     Constructor for the :class:`GzipFile` class, which simulates most of the
     or ``'wb'``, depending on whether the file will be read or written.  The default
     is the mode of *fileobj* if discernible; otherwise, the default is ``'rb'``.
  
 -   Note that the file is always opened in binary mode; text mode is not
 -   supported. If you need to read a compressed file in text mode, wrap your
 -   :class:`GzipFile` with an :class:`io.TextIOWrapper`.
 +   Note that the file is always opened in binary mode. To open a compressed file
 +   in text mode, use :func:`.open` (or wrap your :class:`GzipFile` with an
 +   :class:`io.TextIOWrapper`).
  
-    The *compresslevel* argument is an integer from ``1`` to ``9`` controlling the
-    level of compression; ``1`` is fastest and produces the least compression, and
-    ``9`` is slowest and produces the most compression.  The default is ``9``.
+    The *compresslevel* argument is an integer from ``0`` to ``9`` controlling
+    the level of compression; ``1`` is fastest and produces the least
+    compression, and ``9`` is slowest and produces the most compression. ``0``
+    is no compression. The default is ``9``.
  
     The *mtime* argument is an optional numeric timestamp to be written to
     the stream when compressing.  All :program:`gzip` compressed streams are
index 42535a0e505efb4d4d8aafc14500198d65832bcf,75640d46b44d359dea9828de8c6807e1d94f8101..731023e139ddadc94dec8d06fbb639f68dee12fe
@@@ -51,45 -51,21 +51,46 @@@ The available exception and functions i
  
  .. function:: compress(data[, level])
  
 -   Compresses the bytes in *data*, returning a bytes object containing
 -   compressed data.  *level* is an integer from ``0`` to ``9`` controlling the
 -   level of compression; ``1`` is fastest and produces the least compression,
 -   ``9`` is slowest and produces the most. ``0`` is no compression. The default
 -   value is ``6``.  Raises the :exc:`error` exception if any error occurs.
 +   Compresses the bytes in *data*, returning a bytes object containing compressed data.
-    *level* is an integer from ``1`` to ``9`` controlling the level of compression;
++   *level* is an integer from ``0`` to ``9`` controlling the level of compression;
 +   ``1`` is fastest and produces the least compression, ``9`` is slowest and
-    produces the most.  The default value is ``6``.  Raises the :exc:`error`
-    exception if any error occurs.
++   produces the most.  ``0`` is no compression.  The default value is ``6``.
++   Raises the :exc:`error` exception if any error occurs.
  
  
 -.. function:: compressobj([level])
 +.. function:: compressobj(level=-1, method=DEFLATED, wbits=15, memlevel=8, strategy=Z_DEFAULT_STRATEGY[, zdict])
  
     Returns a compression object, to be used for compressing data streams that won't
 -   fit into memory at once.  *level* is an integer from ``0`` to ``9`` controlling
 -   the level of compression; ``1`` is fastest and produces the least compression,
 -   ``9`` is slowest and produces the most.  ``0`` is no compression.  The default
 +   fit into memory at once.
 +
-    *level* is the compression level -- an integer from ``1`` to ``9``. A value
++   *level* is the compression level -- an integer from ``0`` to ``9``. A value
 +   of ``1`` is fastest and produces the least compression, while a value of
-    ``9`` is slowest and produces the most. The default value is ``6``.
++   ``9`` is slowest and produces the most. ``0`` is no compression. The default
+    value is ``6``.
  
 +   *method* is the compression algorithm. Currently, the only supported value is
 +   ``DEFLATED``.
 +
 +   *wbits* is the base two logarithm of the size of the window buffer. This
 +   should be an integer from ``8`` to ``15``. Higher values give better
 +   compression, but use more memory.
 +
 +   *memlevel* controls the amount of memory used for internal compression state.
 +   Valid values range from ``1`` to ``9``. Higher values using more memory,
 +   but are faster and produce smaller output.
 +
 +   *strategy* is used to tune the compression algorithm. Possible values are
 +   ``Z_DEFAULT_STRATEGY``, ``Z_FILTERED``, and ``Z_HUFFMAN_ONLY``.
 +
 +   *zdict* is a predefined compression dictionary. This is a sequence of bytes
 +   (such as a :class:`bytes` object) containing subsequences that are expected
 +   to occur frequently in the data that is to be compressed. Those subsequences
 +   that are expected to be most common should come at the end of the dictionary.
 +
 +   .. versionchanged:: 3.3
 +      Added the *method*, *wbits*, *memlevel*, *strategy* and *zdict*
 +      parameters.
 +
  
  .. function:: crc32(data[, value])
  
diff --cc Lib/gzip.py
Simple merge
diff --cc Misc/NEWS
index 3e945b15bb75debc7b37d767329362cf16fc93fa,4fc124d8175ab596f35e2ea5f2d54ad615293f2e..20991096dce36b3634019bc6e906d28c195415e9
+++ b/Misc/NEWS
@@@ -171,99 -263,460 +171,102 @@@ 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 #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 #15421: Fix an OverflowError in `Calendar.itermonthdates()` after
 +  `datetime.MAXYEAR`.  Patch by Cédric Krier.
  
 -- 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 #10997: Prevent a duplicate entry in IDLE's "Recent Files" menu.
 -
 -- Issue #14443: Tell rpmbuild to use the correct version of Python in
 -  bdist_rpm. Initial patch by Ross Lagerwall.
 -
 -- Issue #14929: Stop Idle 3.x from closing on Unicode decode errors when
 -  grepping. Patch by Roger Serwy.
 -
 -- 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.
 -
 -- 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 #14876: Use user-selected font for highlight configuration.
 -
 -- Issue #14920: Fix the help(urllib.parse) failure on locale C on terminals.
 -  Have ascii characters in help.
 +- Issue #15447: Use `subprocess.DEVNULL` in webbrowser, instead of opening
 +  `os.devnull` explicitly and leaving it open.
  
 -- Issue #14863: Update the documentation of os.fdopen() to reflect the
 -  fact that it's only a thin wrapper around open() anymore.
 -
 -- Issue #14036: Add an additional check to validate that port in urlparse does
 -  not go in illegal range and returns None.
 +- Issue #15509: `webbrowser.UnixBrowser` no longer passes empty arguments to
 +  Popen when ``%action`` substitutions produce empty strings.
  
 -- Issue #14875: Use float('inf') instead of float('1e66666') in the json module.
 +- 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 #14426: Correct the Date format in Expires attribute of Set-Cookie
 -  Header in Cookie.py.
 +- Issue #15906: Fix a regression in `argparse` caused by the preceding change,
 +  when ``action='append'``, ``type='str'`` and ``default=[]``.
  
 -- Issue #14721: Send the correct 'Content-length: 0' header when the body is an
 -  empty string ''. Initial Patch contributed by Arve Knudsen.
 +Tests
 +-----
  
 -- Issue #14072: Fix parsing of 'tel' URIs in urlparse by making the check for
 -  ports stricter.
 +- Issue #16115: Add some tests for the executable argument to
 +  subprocess.Popen().  Initial patch by Kushal Das.
  
 -- Issue #9374: Generic parsing of query and fragment portions of url for any
 -  scheme. Supported both by RFC3986 and RFC2396.
 +- Issue #15304: Fix warning message when `os.chdir()` fails inside
 +  `test.support.temp_cwd()`.  Patch by Chris Jerdonek.
  
 -- 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 #15802: Fix test logic in `TestMaildir.test_create_tmp()`. Patch by
 +  Serhiy Storchaka.
  
 -- Issue #14829: Fix bisect and range() indexing with large indices
 -  (>= 2 ** 32) under 64-bit Windows.
 +- Issue #15557: Add a test suite for the `webbrowser` module, thanks to Anton
 +  Barkovsky.
  
 -- 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.
 +Build
 +-----
  
 -- Issue #12541: Be lenient with quotes around Realm field of HTTP Basic
 -  Authentation in urllib2.
 +- Issue #16262: fix out-of-src-tree builds, if mercurial is not installed.
  
 -- Issue #14662: Prevent shutil failures on OS X when destination does not
 -  support chflag operations.  Patch by Hynek Schlawack.
 +- Issue #15298: ensure _sysconfigdata is generated in build directory, not
 +  source directory.
  
 -- Issue #14157: Fix time.strptime failing without a year on February 29th.
 -  Patch by Hynek Schlawack.
 +- 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 #14768: os.path.expanduser('~/a') doesn't works correctly when HOME is '/'.
 +- Issue #15923: Fix a mistake in ``asdl_c.py`` that resulted in a TypeError
 +  after 2801bf875a24 (see #15801).
  
 -- Issue #14741: Fix missing support for Ellipsis ('...') in parser module.
 +- Issue #15819: Make sure we can build Python out-of-tree from a read-only
 +  source directory.  (Somewhat related to issue #9860.)
  
 -- Issue #14697: Fix missing support for set displays and set comprehensions in
 -  parser module.
 +Tools/Demos
 +-----------
  
 -- Issue #14701: Fix missing support for 'raise ... from' in parser module.
 +- Issue #13301: use ast.literal_eval() instead of eval() in Tools/i18n/msgfmt.py
 +  Patch by Serhiy Storchaka.
  
 -- Issue #13183: Fix pdb skipping frames after hitting a breakpoint and running
 -  step.  Patch by Xavier de Gaye.
 +Documentation
 +-------------
  
 -- 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 #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 #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.
  
index 5a57fe927f20a553a6b02ed540b688599eb5ed0b,bb453aed637a41ec651e5356ae2c1f53bf36397c..e718795fa70582ea4c790c0217367bbb16e6f921
@@@ -1227,11 -1135,11 +1227,11 @@@ PyDoc_STRVAR(zlib_module_documentation
  "zlib library, which is based on GNU zip.\n"
  "\n"
  "adler32(string[, start]) -- Compute an Adler-32 checksum.\n"
- "compress(string[, level]) -- Compress string, with compression level in 1-9.\n"
+ "compress(string[, level]) -- Compress string, with compression level in 0-9.\n"
 -"compressobj([level]) -- Return a compressor object.\n"
 +"compressobj([level[, ...]]) -- Return a compressor object.\n"
  "crc32(string[, start]) -- Compute a CRC-32 checksum.\n"
  "decompress(string,[wbits],[bufsize]) -- Decompresses a compressed string.\n"
 -"decompressobj([wbits]) -- Return a decompressor object.\n"
 +"decompressobj([wbits[, zdict]]]) -- Return a decompressor object.\n"
  "\n"
  "'wbits' is window buffer size.\n"
  "Compressor objects support compress() and flush() methods; decompressor\n"