Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Lib/test/test_mmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def test_basic(self):
f.flush()
m = mmap.mmap(f.fileno(), 2 * PAGESIZE)
self.addCleanup(m.close)
self.assertEqual(f.tell(), 2 * PAGESIZE)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What f.tell() returned before this change? What m.tell() returned and what it returns now?

finally:
f.close()

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Creating a :class:`mmap.mmap` object on Windows no longer resets the position
of the underlying file to zero, as on other platforms.
3 changes: 0 additions & 3 deletions Modules/mmapmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -2084,9 +2084,6 @@ new_mmap_object(PyTypeObject *type, PyObject *args, PyObject *kwdict)
fh = _Py_get_osfhandle(fileno);
if (fh == INVALID_HANDLE_VALUE)
return NULL;

/* Win9x appears to need us seeked to zero */
lseek(fileno, 0, SEEK_SET);
}

m_obj = (mmap_object *)type->tp_alloc(type, 0);
Expand Down
Loading