Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
ee513ac7
Commit
ee513ac7
authored
Aug 15, 2012
by
R David Murray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#15543: reflow paragraphs.
parent
4f9609a9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
34 deletions
+31
-34
Doc/library/functions.rst
Doc/library/functions.rst
+2
-3
Doc/library/importlib.rst
Doc/library/importlib.rst
+3
-4
Doc/library/io.rst
Doc/library/io.rst
+7
-7
Doc/library/zipfile.rst
Doc/library/zipfile.rst
+7
-7
Doc/whatsnew/2.3.rst
Doc/whatsnew/2.3.rst
+6
-7
Doc/whatsnew/2.5.rst
Doc/whatsnew/2.5.rst
+6
-6
No files found.
Doc/library/functions.rst
View file @
ee513ac7
...
...
@@ -878,9 +878,8 @@ are always available. They are listed here in alphabetical order.
single: universal newlines; open() built-in function
*newline* controls how :term:`universal newlines` mode works (it only
applies to text mode).
It can be ``None``, ``''``, ``'\n'``, ``'\r'``, and ``'\r\n'``. It
works as follows:
applies to text mode). It can be ``None``, ``''``, ``'\n'``, ``'\r'``, and
``'\r\n'``. It works as follows:
* When reading input from the stream, if *newline* is ``None``, universal
newlines mode is enabled. Lines in the input can end in ``'\n'``,
...
...
Doc/library/importlib.rst
View file @
ee513ac7
...
...
@@ -196,10 +196,9 @@ are also provided to help in implementing the core ABCs.
An
abstract
method
to
return
the
source
of
a
module
.
It
is
returned
as
a
text
string
using
:
term
:`
universal
newlines
`,
translating
all
recognized
line
separators
into
``
'\n'
``
characters
.
Returns
``
None
``
if
no
source
is
available
(
e
.
g
.
a
built
-
in
module
).
Raises
:
exc
:`
ImportError
`
if
the
loader
cannot
find
the
module
specified
.
recognized
line
separators
into
``
'\n'
``
characters
.
Returns
``
None
``
if
no
source
is
available
(
e
.
g
.
a
built
-
in
module
).
Raises
:
exc
:`
ImportError
`
if
the
loader
cannot
find
the
module
specified
.
..
method
::
is_package
(
fullname
)
...
...
Doc/library/io.rst
View file @
ee513ac7
...
...
@@ -764,13 +764,13 @@ Text I/O
``''``, ``'\n'``, ``'\r'``, and ``'\r\n'``. It works as follows:
* When reading input from the stream, if *newline* is ``None``,
:term:`universal newlines` mode is enabled. Lines in the input can end
in ``'\n'``,
``'\r'``, or ``'\r\n'``, and these are translated into ``'\n'`` before
being returned to the caller. If it is ``''``, universal newlines mode is
enabled, but line endings are returned to the caller untranslated. If it
has any of the other legal values, input lines are only terminated by the
given string, and the line ending is returned to the caller
untranslated.
:term:`universal newlines` mode is enabled. Lines in the input can end
in
``'\n'``, ``'\r'``, or ``'\r\n'``, and these are translated into ``'\n'``
before being returned to the caller. If it is ``''``, universal newlines
mode is enabled, but line endings are returned to the caller untranslated.
If it has any of the other legal values, input lines are only terminated
by the given string, and the line ending is returned to the caller
untranslated.
* When writing output to the stream, if *newline* is ``None``, any ``'\n'``
characters written are translated to the system default line separator,
...
...
Doc/library/zipfile.rst
View file @
ee513ac7
...
...
@@ -174,13 +174,13 @@ ZipFile Objects
.. method:: ZipFile.open(name, mode='
r
', pwd=None)
Extract a member from the archive as a file-like object (ZipExtFile). *name*
is
the name of the file in the archive, or a :class:`ZipInfo` object. The *mode*
parameter, if included, must be one of the following: ``'
r
'`` (the default),
``'
U
'``, or ``'
rU
'``. Choosing ``'
U
'`` or ``'
rU
'`` will enable
:term:`universal newlines` support in the read-only object.
*pwd* is the password used for encrypted files.
Calling :meth:`open` on a closed
ZipFile will raise a :exc:`RuntimeError`.
Extract a member from the archive as a file-like object (ZipExtFile). *name*
is the name of the file in the archive, or a :class:`ZipInfo` object. The
*mode* parameter, if included, must be one of the following: ``'
r
'`` (the
default),
``'
U
'``, or ``'
rU
'``. Choosing ``'
U
'`` or ``'
rU
'`` will enable
:term:`universal newlines` support in the read-only object.
*pwd* is the
password used for encrypted files. Calling :meth:`open` on a closed
ZipFile will raise a :exc:`RuntimeError`.
.. note::
...
...
Doc/whatsnew/2.3.rst
View file @
ee513ac7
...
...
@@ -379,13 +379,12 @@ mark the ends of lines in text files. Unix uses the linefeed (ASCII character
10), MacOS uses the carriage return (ASCII character 13), and Windows uses a
two-character sequence of a carriage return plus a newline.
Python's file objects can now support end of line conventions other than the one
followed by the platform on which Python is running. Opening a file with the
mode ``'U'`` or ``'rU'`` will open a file for reading in
:term:`universal newlines` mode.
All three line ending conventions will be translated to a ``'
\n
'`` in the
strings returned by the various file methods such as :meth:`read` and
:meth:`readline`.
Python's file objects can now support end of line conventions other than the
one followed by the platform on which Python is running. Opening a file with
the mode ``'U'`` or ``'rU'`` will open a file for reading in :term:`universal
newlines` mode. All three line ending conventions will be translated to a
``'
\n
'`` in the strings returned by the various file methods such as
:meth:`read` and :meth:`readline`.
Universal newline support is also used when importing modules and when executing
a file with the :func:`execfile` function. This means that Python modules can
...
...
Doc/whatsnew/2.5.rst
View file @
ee513ac7
...
...
@@ -1343,12 +1343,12 @@ complete list of changes, or look through the SVN logs for all the details.
* The :mod:`fileinput` module was made more flexible. Unicode filenames are now
supported, and a *mode* parameter that defaults to ``"r"`` was added to the
:func:`input` function to allow opening files in binary or
:term:`universal newlines` mode.
Another new parameter, *openhook*, lets you use a function other than
:func:`open` to open the input files. Once you're iterating over the set of
files, the :class:`FileInput` object's new :meth:`fileno` returns the file
descriptor for the currently opened file. (Contributed by Georg
Brandl.)
:func:`input` function to allow opening files in binary or
:term:`universal
newlines` mode. Another new parameter, *openhook*, lets you use a function
other than :func:`open` to open the input files. Once you're iterating over
the set of files, the :class:`FileInput` object's new :meth:`fileno` returns
the file descriptor for the currently opened file. (Contributed by Georg
Brandl.)
* In the :mod:`gc` module, the new :func:`get_count` function returns a 3-tuple
containing the current collection counts for the three GC generations. This is
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment