[issue2122] mmap.flush does not check for errors on windows

Hirokazu Yamamoto report at bugs.python.org
Mon Jun 13 05:00:20 CEST 2011


Hirokazu Yamamoto <ocean-city at m2.ccsnet.ne.jp> added the comment:

This issue seems to be reproduced in following way.

1. Attach USB flash drive. (On my machine, it was attached as E drive)

2. Run python interactive shell and run following commands.
   (Confirmed on Python2.6)

  > import mmap
  > f = open("e:/temp.tmp", "w+b")
  > f.write("foo")
  > f.flush()
  > m = mmap.mmap(f.fileno(), 3)
  > m[:] = "xxx"

3. Detach USB flash drive violently here! (Without safety mechanism
   to detach USB flash drive, just plug it off) Note that
   python shell is still running.

4. Enter following command in python shell.
  > m.flush()
   It returns *0*. (Means failure)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue2122>
_______________________________________


More information about the Python-bugs-list mailing list