From: Senthil Kumaran Date: Mon, 22 Feb 2010 17:17:22 +0000 (+0000) Subject: Fixing Issue7399 - Fixing an example of urllib usage. X-Git-Tag: v3.2a1~1657 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ac0b889e82e01740aaee788868afe7724cb141fd;p=thirdparty%2FPython%2Fcpython.git Fixing Issue7399 - Fixing an example of urllib usage. --- diff --git a/Doc/tutorial/stdlib.rst b/Doc/tutorial/stdlib.rst index d9a15fa70037..0f607c402213 100644 --- a/Doc/tutorial/stdlib.rst +++ b/Doc/tutorial/stdlib.rst @@ -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)