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 neologix
Recipients SilentGhost, eric.araujo, facundobatista, georg.brandl, josiahcarlson, lorenz, neologix, pitrou, schmir
Date 2011-06-09.17:06:26
SpamBayes Score 1.7123864e-06
Marked as misclassified No
Message-id <1307639187.61.0.558620631315.issue10897@psf.upfronthosting.co.za>
In-reply-to
Content
Trying to revive this issue.
I'm +1 on this change: duping the file descriptor is definitely unexpected and has some side effects.
I think we should remove the call to dup and close, it's really the user's responsibility to avoid closing the FD.
If the FD is closed when mmap_resize is called, ftruncate will fail with EBADF, without harm.
The real problem is more if the file has been closed and another one got open, with the same FD.
If we wanted to be paranoid and avoid truncating/re-mapping another file, we could store the struct stat's st_ino field when the mapping is created, and re-check its value in mmap_resize (and if we wanted to be really paranoid we could also store st_dev, because inodes are unique only within a given file system).
History
Date User Action Args
2011-06-09 17:06:27neologixsetrecipients: + neologix, georg.brandl, facundobatista, josiahcarlson, pitrou, schmir, eric.araujo, SilentGhost, lorenz
2011-06-09 17:06:27neologixsetmessageid: <1307639187.61.0.558620631315.issue10897@psf.upfronthosting.co.za>
2011-06-09 17:06:27neologixlinkissue10897 messages
2011-06-09 17:06:26neologixcreate