Preserving logging streams through a daemon.DaemonContext switch (was: daemon.DaemonContext)
Vinay Sajip
vinay_sajip at yahoo.co.uk
Fri Apr 9 09:26:36 EDT 2010
On Apr 9, 12:46 am, Ben Finney <ben+pyt... at benfinney.id.au> wrote:
> > I think you just have to pass the file object used by the handler
> > (fh.stream) in the files_preserve array.
>
> Not quite. As the docs specify, you need to pass the *file descriptors*
> for the files you want preserved.
Okay, but the docstring you quoted:
"Elements of the list are file descriptors (as returned by a file
object's `fileno()` method) or Python `file` objects."
implies that fh.stream would work as well as fh.stream.fileno(), and I
presume you internally do a hasattr(thingy, 'fileno') to get the
descriptor.
Regards,
Vinay Sajip
More information about the Python-list
mailing list