diff Doc/tutorial/stdlib.rst @ 59019:c88b6602f82d

Fixing Issue7399 - Fixing an example of urllib usage.
author Senthil Kumaran <orsenthil@gmail.com>
date Mon, 22 Feb 2010 17:17:22 +0000
parents e23f5ec93315
children ad79f9b3a021 f923fe55a40c
line wrap: on
line diff
--- a/Doc/tutorial/stdlib.rst	Mon Feb 22 16:52:52 2010 +0000
+++ b/Doc/tutorial/stdlib.rst	Mon Feb 22 17:17:22 2010 +0000
@@ -152,6 +152,7 @@
 
    >>> from urllib.request import urlopen
    >>> for line in urlopen('http://tycho.usno.navy.mil/cgi-bin/timer.pl'):
+   ...     line = line.decode('utf-8')  # Decoding the binary data to text.
    ...     if 'EST' in line or 'EDT' in line:  # look for Eastern Time
    ...         print(line)