From: Serhiy Storchaka Date: Wed, 19 Oct 2016 15:36:51 +0000 (+0300) Subject: Issue #19795: Improved more markups of True/False. X-Git-Tag: v3.6.0b3~101 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7d6dda4b783dc8720b354e5ede766fcb8407de14;p=python Issue #19795: Improved more markups of True/False. --- 7d6dda4b783dc8720b354e5ede766fcb8407de14 diff --cc Doc/library/readline.rst index 37e400eceb,4d3c099ed2..54c54b461c --- a/Doc/library/readline.rst +++ b/Doc/library/readline.rst @@@ -167,20 -167,6 +167,20 @@@ The following functions operate on a gl This calls :c:func:`add_history` in the underlying library. +.. function:: set_auto_history(enabled) + + Enable or disable automatic calls to :c:func:`add_history` when reading + input via readline. The *enabled* argument should be a Boolean value - that when true, enables auto history, and that when False, disables ++ that when true, enables auto history, and that when false, disables + auto history. + + .. versionadded:: 3.6 + + .. impl-detail:: + Auto history is enabled by default, and changes to this do not persist + across multiple sessions. + + Startup hooks ------------- diff --cc Doc/library/subprocess.rst index 26cf5bcfc6,c1b28f8fc3..ad2abe8245 --- a/Doc/library/subprocess.rst +++ b/Doc/library/subprocess.rst @@@ -61,20 -60,15 +61,20 @@@ compatibility with older versions, see The *input* argument is passed to :meth:`Popen.communicate` and thus to the subprocess's stdin. If used it must be a byte sequence, or a string if - *encoding* or *errors* is specified or *universal_newlines* is True. When - ``universal_newlines=True``. When used, the internal :class:`Popen` object - is automatically created with ``stdin=PIPE``, and the *stdin* argument may - not be used as well. ++ *encoding* or *errors* is specified or *universal_newlines* is true. When + used, the internal :class:`Popen` object is automatically created with + ``stdin=PIPE``, and the *stdin* argument may not be used as well. - If *check* is True, and the process exits with a non-zero exit code, a + If *check* is true, and the process exits with a non-zero exit code, a :exc:`CalledProcessError` exception will be raised. Attributes of that exception hold the arguments, the exit code, and stdout and stderr if they were captured. - If *encoding* or *errors* are specified, or *universal_newlines* is True, ++ If *encoding* or *errors* are specified, or *universal_newlines* is true, + file objects for stdin, stdout and stderr are opened in text mode using the + specified *encoding* and *errors* or the :class:`io.TextIOWrapper` default. + Otherwise, file objects are opened in binary mode. + Examples:: >>> subprocess.run(["ls", "-l"]) # doesn't capture output @@@ -259,22 -249,19 +259,22 @@@ default values. The arguments that are .. index:: single: universal newlines; subprocess module - If *encoding* or *errors* are specified, or *universal_newlines* is True, - If *universal_newlines* is ``False`` the file objects *stdin*, *stdout* and - *stderr* will be opened as binary streams, and no line ending conversion is - done. ++ If *encoding* or *errors* are specified, or *universal_newlines* is true, + the file objects *stdin*, *stdout* and *stderr* will be opened in text + mode using the *encoding* and *errors* specified in the call or the + defaults for :class:`io.TextIOWrapper`. + + For *stdin*, line ending characters ``'\n'`` in the input will be converted + to the default line separator :data:`os.linesep`. For *stdout* and *stderr*, + all line endings in the output will be converted to ``'\n'``. For more + information see the documentation of the :class:`io.TextIOWrapper` class + when the *newline* argument to its constructor is ``None``. - If *universal_newlines* is ``True``, these file objects - will be opened as text streams in :term:`universal newlines` mode - using the encoding returned by :func:`locale.getpreferredencoding(False) - `. For *stdin*, line ending characters - ``'\n'`` in the input will be converted to the default line separator - :data:`os.linesep`. For *stdout* and *stderr*, all line endings in the - output will be converted to ``'\n'``. For more information see the - documentation of the :class:`io.TextIOWrapper` class when the *newline* - argument to its constructor is ``None``. + If text mode is not used, *stdin*, *stdout* and *stderr* will be opened as + binary streams. No encoding or line ending conversion is performed. + + .. versionadded:: 3.6 + Added *encoding* and *errors* parameters. .. note:: diff --cc Doc/library/zipfile.rst index bf52fa31ae,1d6526ce95..47ba0b521e --- a/Doc/library/zipfile.rst +++ b/Doc/library/zipfile.rst @@@ -498,31 -465,7 +498,31 @@@ Instances of the :class:`ZipInfo` clas :meth:`.infolist` methods of :class:`ZipFile` objects. Each object stores information about a single member of the ZIP archive. -Instances have the following attributes: +There is one classmethod to make a :class:`ZipInfo` instance for a filesystem +file: + +.. classmethod:: ZipInfo.from_file(filename, arcname=None) + + Construct a :class:`ZipInfo` instance for a file on the filesystem, in + preparation for adding it to a zip file. + + *filename* should be the path to a file or directory on the filesystem. + + If *arcname* is specified, it is used as the name within the archive. + If *arcname* is not specified, the name will be the same as *filename*, but + with any drive letter and leading path separators removed. + + .. versionadded:: 3.6 + +Instances have the following methods and attributes: + +.. method:: ZipInfo.is_dir() + - Return True if this archive member is a directory. ++ Return ``True`` if this archive member is a directory. + + This uses the entry's name: directories should always end with ``/``. + + .. versionadded:: 3.6 .. attribute:: ZipInfo.filename