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 josiahcarlson
Recipients
Date 2007-01-06.22:48:59
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
I believe that asyncore.file_dispatcher taking a file descriptor is fine.  The problem is that the documentation doesn't suggest that you os.dup() the file handle so that both the original handle (from a pipe, file, etc.) can be closed independently from the one being used by the file_dispatcher.  In the case of socket.makefile(), the duplication is done automatically, so there isn't the same problem.

My suggested fix would be to accept a file or a file handle.  For files, we first get its file number via the standard f.fileno(), and with that, or the handle we are provided, we os.dup() the handle.
History
Date User Action Args
2007-08-23 14:26:07adminlinkissue1025525 messages
2007-08-23 14:26:07admincreate