From 5bb7c62058dab0f6073b20ee11faaf94fe43ec69 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Tue, 13 Aug 2013 13:04:59 -0700 Subject: [PATCH] Create distinct fileinput objects in htmlifier. * .../logs/htmlify-screen-log.py: fileinput.input is a global attempting to update it when it is already active causes problems. Instead create dinstinct FileInput objects for iterating over files to avoid problems with globals. Change-Id: I6ac585e55c918b9bcdb188d347049cbb3abb4125 --- modules/openstack_project/files/logs/htmlify-screen-log.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/openstack_project/files/logs/htmlify-screen-log.py b/modules/openstack_project/files/logs/htmlify-screen-log.py index e27e319c6f..8625f859f4 100755 --- a/modules/openstack_project/files/logs/htmlify-screen-log.py +++ b/modules/openstack_project/files/logs/htmlify-screen-log.py @@ -81,7 +81,7 @@ def link_timestamp(line): def passthrough_filter(fname): - for line in fileinput.input(fname, openhook=fileinput.hook_compressed): + for line in fileinput.FileInput(fname, openhook=fileinput.hook_compressed): yield line @@ -111,7 +111,7 @@ def html_filter(fname): """ yield _css_preamble() - for line in fileinput.input(fname, openhook=fileinput.hook_compressed): + for line in fileinput.FileInput(fname, openhook=fileinput.hook_compressed): newline = escape_html(line) newline = color_by_sev(newline) newline = link_timestamp(newline) @@ -122,7 +122,7 @@ def html_filter(fname): def htmlify_stdin(): out = sys.stdout out.write(_css_preamble()) - for line in fileinput.input(): + for line in fileinput.FileInput(): newline = escape_html(line) newline = color_by_sev(newline) newline = link_timestamp(newline)