[issue10897] UNIX mmap unnecessarily dup() file descriptor

Lorenz Huedepohl report at bugs.python.org
Wed Jan 12 21:22:13 CET 2011


Lorenz Huedepohl <lorenz at mpa-garching.mpg.de> added the comment:

Thanks SilentGhost, you were much faster than me :)

I agree with Antoine, that the dup() is unexpected: It cost me some time to figure out where these additonal file descriptors originated from. One of the powers of mmap() is, that you do not need one, so it would really be great if this feature could be saved into the python abstraction.

As for the example: I think this could be cured by removing the close(m_obj->fd); statement, again shifing the responsibility for that to the creator of the intial file handle - see my attached patch.
(This time against the py3k patch)

BTW: It is a great experience for a python user to see just how fast you guys react to an issue here! Thanks!

----------
Added file: http://bugs.python.org/file20381/no_dup_no_close.py3k.patch

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


More information about the Python-bugs-list mailing list