]> granicus.if.org Git - python/commitdiff
Fixing Issue7399 - Fixing an example of urllib usage.
authorSenthil Kumaran <orsenthil@gmail.com>
Mon, 22 Feb 2010 17:17:22 +0000 (17:17 +0000)
committerSenthil Kumaran <orsenthil@gmail.com>
Mon, 22 Feb 2010 17:17:22 +0000 (17:17 +0000)
Doc/tutorial/stdlib.rst

index d9a15fa70037de4ee9bac1f0bc76352550b39521..0f607c402213321f741351b8c2bacd522087ed5b 100644 (file)
@@ -152,6 +152,7 @@ from urls and :mod:`smtplib` for sending mail::
 
    >>> 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)