This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author benrg
Recipients benrg, paul.moore, steve.dower, tim.golden, zach.ware
Date 2022-02-25.20:47:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1645822069.83.0.570318294839.issue46858@roundup.psfhosted.org>
In-reply-to
Content
On Windows, `mmap.mmap(f.fileno(), ...)` has the undocumented side effect of setting f's file pointer to 0.

The responsible code in mmapmodule is this:

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

Win9x is no longer supported, and I'm quite sure that NT doesn't have whatever problem they were trying to fix. I think this code should be deleted, and a regression test added to verify that mmap leaves the file pointer alone on all platforms.

(mmap also maintains its own file pointer, the `pos` field of `mmap_object`, which is initially set to zero. This issue is about the kernel file pointer, not mmap's pointer.)
History
Date User Action Args
2022-02-25 20:47:49benrgsetrecipients: + benrg, paul.moore, tim.golden, zach.ware, steve.dower
2022-02-25 20:47:49benrgsetmessageid: <1645822069.83.0.570318294839.issue46858@roundup.psfhosted.org>
2022-02-25 20:47:49benrglinkissue46858 messages
2022-02-25 20:47:49benrgcreate