We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 51d4bf1 commit acafffdCopy full SHA for acafffd
Doc/library/urllib.request.rst
@@ -1249,7 +1249,10 @@ It is also possible to achieve the same result without using the
1249
1250
>>> import urllib.request
1251
>>> f = urllib.request.urlopen('http://www.python.org/')
1252
- >>> print(f.read(100).decode('utf-8'))
+ >>> try:
1253
+ ... print(f.read(100).decode('utf-8'))
1254
+ ... finally:
1255
+ ... f.close()
1256
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
1257
"http://www.w3.org/TR/xhtml1/DTD/xhtm
1258
0 commit comments