]> granicus.if.org Git - python/commitdiff
Binary flag is needed on windows.
authorHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
Sat, 28 Feb 2009 15:24:00 +0000 (15:24 +0000)
committerHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
Sat, 28 Feb 2009 15:24:00 +0000 (15:24 +0000)
Doc/library/mmap.rst

index 09ec73b094520320e5a4fe253d6dcab721fec457..a6e9bdc855c1c5a8cb177f28a6755df8b1630c64 100644 (file)
@@ -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