summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorMark Summerfield <list@qtrac.plus.com>2007-12-14 18:23:42 (GMT)
committerMark Summerfield <list@qtrac.plus.com>2007-12-14 18:23:42 (GMT)
commit517b9ddda231467e87aafd243c6c561f68d34490 (patch)
tree0c876b1db41a83de484e6efcfd68e02e87b21701 /Doc
parentecff60ea606e24b3eee6a009fd63b5b2cf54d350 (diff)
downloadcpython-517b9ddda231467e87aafd243c6c561f68d34490.zip
cpython-517b9ddda231467e87aafd243c6c561f68d34490.tar.gz
cpython-517b9ddda231467e87aafd243c6c561f68d34490.tar.bz2
Couple of corrections to open() doc as per email from GvR.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/functions.rst14
1 files changed, 8 insertions, 6 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index 321af87..14fd1a7 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -724,7 +724,7 @@ available. They are listed here in alphabetical order.
it already exists), and ``'a'`` for appending (which on *some* Unix
systems means that *all* writes append to the end of the file
regardless of the current seek position). In text mode, if *encoding*
- is not specified the encoding is assumed to be UTF-8. (For reading
+ is not specified the encoding used is platform dependent. (For reading
and writing raw bytes use binary mode and leave *encoding*
unspecified.) The available modes are:
@@ -748,7 +748,8 @@ available. They are listed here in alphabetical order.
``bytes`` objects without any decoding. In text mode (the default,
or when ``'t'`` is appended to the *mode* argument) the contents of
the file are returned as strings, the bytes having been first decoded
- using the UTF-8 encoding or using the specified *encoding* if given.
+ using a platform-dependent encoding or using the specified *encoding*
+ if given.
*buffering* is an optional integer used to set the buffering policy. By
default full buffering is on. Pass 0 to switch buffering off (only
@@ -757,16 +758,17 @@ available. They are listed here in alphabetical order.
*encoding* is an optional string that specifies the file's encoding when
reading or writing in text mode---this argument should not be used in
- binary mode. The default encoding is UTF-8, but any encoding
+ binary mode. The default encoding is platform dependent, but any encoding
supported by Python can be used. (See the :mod:`codecs` module for
the list of supported encodings.)
*errors* is an optional string that specifies how encoding errors are to be
handled---this argument should not be used in binary mode. Pass
``'strict'`` to raise a :exc:`ValueError` exception if there is an encoding
- error, or ``'ignore'`` to ignore errors. (Note that ignoring encoding
- errors can lead to data loss.) See the documentation for
- :func:`codecs.register` for a list of the permitted encoding error strings.
+ error (the default of ``None`` has the same effect), or pass ``'ignore'``
+ to ignore errors. (Note that ignoring encoding errors can lead to
+ data loss.) See the documentation for :func:`codecs.register` for a
+ list of the permitted encoding error strings.
*newline* is an optional string that specifies the newline character(s).
When reading, if *newline* is ``None``, universal newlines mode is enabled.