summaryrefslogtreecommitdiffstats
path: root/Doc/howto
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-10-13 20:12:09 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-10-13 20:12:09 (GMT)
commit98b28fddd8e63e1a9410facee3e41925eed8ac46 (patch)
tree410d277cbb20078d5fd226e8dd4d24bd225237d8 /Doc/howto
parent6039db8de30b5c20ba864cc4127fbfabf6fc0641 (diff)
parentbfdcd436f0410e2b3eb34ce4fd7411488d3f13fb (diff)
downloadcpython-98b28fddd8e63e1a9410facee3e41925eed8ac46.zip
cpython-98b28fddd8e63e1a9410facee3e41925eed8ac46.tar.gz
cpython-98b28fddd8e63e1a9410facee3e41925eed8ac46.tar.bz2
Issue #18758: Fixed and improved cross-references.
Diffstat (limited to 'Doc/howto')
-rw-r--r--Doc/howto/unicode.rst10
-rw-r--r--Doc/howto/urllib2.rst2
2 files changed, 7 insertions, 5 deletions
diff --git a/Doc/howto/unicode.rst b/Doc/howto/unicode.rst
index 486195a..4fc8c5c 100644
--- a/Doc/howto/unicode.rst
+++ b/Doc/howto/unicode.rst
@@ -531,9 +531,10 @@ The solution would be to use the low-level decoding interface to catch the case
of partial coding sequences. The work of implementing this has already been
done for you: the built-in :func:`open` function can return a file-like object
that assumes the file's contents are in a specified encoding and accepts Unicode
-parameters for methods such as :meth:`read` and :meth:`write`. This works through
-:func:`open`\'s *encoding* and *errors* parameters which are interpreted just
-like those in :meth:`str.encode` and :meth:`bytes.decode`.
+parameters for methods such as :meth:`~io.TextIOBase.read` and
+:meth:`~io.TextIOBase.write`. This works through:func:`open`\'s *encoding* and
+*errors* parameters which are interpreted just like those in :meth:`str.encode`
+and :meth:`bytes.decode`.
Reading Unicode from a file is therefore simple::
@@ -656,7 +657,8 @@ encodings, taking a stream that returns data in encoding #1
and behaving like a stream returning data in encoding #2.
For example, if you have an input file *f* that's in Latin-1, you
-can wrap it with a :class:`StreamRecoder` to return bytes encoded in UTF-8::
+can wrap it with a :class:`~codecs.StreamRecoder` to return bytes encoded in
+UTF-8::
new_f = codecs.StreamRecoder(f,
# en/decoder: used by read() to encode its results and
diff --git a/Doc/howto/urllib2.rst b/Doc/howto/urllib2.rst
index b683ab6..7b217ea 100644
--- a/Doc/howto/urllib2.rst
+++ b/Doc/howto/urllib2.rst
@@ -57,7 +57,7 @@ The simplest way to use urllib.request is as follows::
html = response.read()
If you wish to retrieve a resource via URL and store it in a temporary location,
-you can do so via the :func:`urlretrieve` function::
+you can do so via the :func:`~urllib.request.urlretrieve` function::
import urllib.request
local_filename, headers = urllib.request.urlretrieve('http://python.org/')