summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2009-02-28 15:24:00 (GMT)
committerHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2009-02-28 15:24:00 (GMT)
commit02172ddbee4a07f053468844acb1f9442963e08e (patch)
tree4816458b6d1f93004b89e41c8ef4bd8f943de2a9
parentb0e10c760c8b7907aee3253054f5ac65fe1b1d12 (diff)
downloadcpython-02172ddbee4a07f053468844acb1f9442963e08e.zip
cpython-02172ddbee4a07f053468844acb1f9442963e08e.tar.gz
cpython-02172ddbee4a07f053468844acb1f9442963e08e.tar.bz2
Binary flag is needed on windows.
-rw-r--r--Doc/library/mmap.rst4
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/library/mmap.rst b/Doc/library/mmap.rst
index 09ec73b..a6e9bdc 100644
--- a/Doc/library/mmap.rst
+++ b/Doc/library/mmap.rst
@@ -99,10 +99,10 @@ memory but does not update the underlying file.
import mmap
# write a simple example file
- with open("hello.txt", "w") as f:
+ with open("hello.txt", "wb") as f:
f.write("Hello Python!\n")
- with open("hello.txt", "r+") as f:
+ with open("hello.txt", "r+b") as f:
# memory-map the file, size 0 means whole file
map = mmap.mmap(f.fileno(), 0)
# read content via standard file methods