diff options
| author | Antoine Pitrou <solipsis@pitrou.net> | 2011-07-11 01:38:27 +0200 |
|---|---|---|
| committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-07-11 01:38:27 +0200 |
| commit | 3b2a62033bba6c264e77a658151b66d41fb569da (patch) | |
| tree | e51710406d8e1ed1067c6042d5034fa8a8bc2a2c /Doc/tutorial/stdlib2.rst | |
| parent | 81f186eb1d7d1e700554bfc9c7d0ceaf9e13884d (diff) | |
| parent | 3d1f0a6718c4b792921b2924561209ea971e1ae8 (diff) | |
| download | cpython-3b2a62033bba6c264e77a658151b66d41fb569da.tar.gz | |
Issue #12343: Add some notes on behaviour of non-blocking SSL sockets.
Diffstat (limited to 'Doc/tutorial/stdlib2.rst')
| -rw-r--r-- | Doc/tutorial/stdlib2.rst | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Doc/tutorial/stdlib2.rst b/Doc/tutorial/stdlib2.rst index fe7f027b53..85c88dc23f 100644 --- a/Doc/tutorial/stdlib2.rst +++ b/Doc/tutorial/stdlib2.rst @@ -141,7 +141,9 @@ standard size and in little-endian byte order:: import struct - data = open('myfile.zip', 'rb').read() + with open('myfile.zip', 'rb') as f: + data = f.read() + start = 0 for i in range(3): # show the first 3 file headers start += 14 @@ -271,7 +273,7 @@ applications include caching objects that are expensive to create:: Traceback (most recent call last): File "<stdin>", line 1, in <module> d['primary'] # entry was automatically removed - File "C:/python31/lib/weakref.py", line 46, in __getitem__ + File "C:/python33/lib/weakref.py", line 46, in __getitem__ o = self.data[key]() KeyError: 'primary' |
