* [PATCH] knotty: Ensure consolelog file handle is closed
@ 2016-05-11 21:55 Richard Purdie
0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2016-05-11 21:55 UTC (permalink / raw)
To: bitbake-devel
If we don't close the console log file handle, python prints a warning
about unclosed file handles upon exit which is annoying.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py
index 903d72b..85a71f4 100644
--- a/bitbake/lib/bb/ui/knotty.py
+++ b/bitbake/lib/bb/ui/knotty.py
@@ -278,6 +278,7 @@ def main(server, eventHandler, params, tf = TerminalFilter):
server.terminateServer()
return
+ consolelog = None
if consolelogfile and not params.options.show_environment and not params.options.show_versions:
bb.utils.mkdirhier(os.path.dirname(consolelogfile))
conlogformat = bb.msg.BBLogFormatter(format_str)
@@ -591,4 +592,8 @@ def main(server, eventHandler, params, tf = TerminalFilter):
if e.errno == errno.EPIPE:
pass
+ if consolelog:
+ logger.removeHandler(consolelog)
+ consolelog.close()
+
return return_value
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2016-05-11 22:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-11 21:55 [PATCH] knotty: Ensure consolelog file handle is closed Richard Purdie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox