Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 850643 Details for
Bug 1053794
xml parser errors reading output logs
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch escaping output to log file
0004-1053794-xml-parser-errors-reading-output-logs.patch (text/plain), 2.39 KB, created by
Greg Nichols
on 2014-01-15 19:19:22 UTC
(
hide
)
Description:
patch escaping output to log file
Filename:
MIME Type:
Creator:
Greg Nichols
Created:
2014-01-15 19:19:22 UTC
Size:
2.39 KB
patch
obsolete
>From c0cfe4217b6e38a3e9153ae9c2fe5ef232403971 Mon Sep 17 00:00:00 2001 >From: Greg Nichols <gnichols@redhat.com> >Date: Wed, 15 Jan 2014 14:17:46 -0500 >Subject: [PATCH 4/4] 1053794 - xml parser errors reading output logs > >--- > hwcert/documentbase.py | 13 +++++-------- > hwcert/log.py | 18 ++++++++++-------- > 2 files changed, 15 insertions(+), 16 deletions(-) > >diff --git a/hwcert/documentbase.py b/hwcert/documentbase.py >index 7205f54..959e482 100644 >--- a/hwcert/documentbase.py >+++ b/hwcert/documentbase.py >@@ -270,14 +270,11 @@ class DocumentBase(DocumentWrapper): > except OSError: > pass > file = open(filename, "r") >- try: >- if self.loadedFileSize: >- self.document = parse(file) >- else: >- print "Error: %s has a size of 0" % filename >- except Exception, e: >- print "Error: could not parse %s" % filename >- print e >+ >+ if self.loadedFileSize: >+ self.document = parse(file) >+ else: >+ print "Error: %s has a size of 0" % filename > self.document = None > > file.close() >diff --git a/hwcert/log.py b/hwcert/log.py >index 373ce4c..d578e9c 100644 >--- a/hwcert/log.py >+++ b/hwcert/log.py >@@ -14,8 +14,11 @@ > # Author: Greg Nichols > > import sys, os >+from xml.sax.saxutils import escape > > class Log(object): >+ asciiBadForXML = map(chr, range(9) + range(11,13) + range(14,32)) >+ > def __init__(self, filePath): > sys.stdout.flush() > try: >@@ -27,25 +30,24 @@ class Log(object): > if not size: > self.log.write("<output>\n") > >- > def write(self, message): > self.terminal.write(message) > if self.log: >- self.log.write(message) >- >+ self.log.write(escape(message)) >+ > def logOnly(self, message): >- self.log.write(message) >- >+ self.log.write(escape(message)) >+ > def flush(self): > self.terminal.flush() > if self.log: > self.log.flush() >- >+ > def close(self): > self.log.write("</output>\n") > self.log.close() > self.log = None >- >+ > def unitTest(): > print "Creating log qq.txt" > log = Log("qq.txt") >@@ -65,7 +67,7 @@ def unitTest(): > return False > > >- >+ > if __name__ == "__main__": > if not unitTest(): > print "log.py unit test FAILED" >-- >1.8.4.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1053794
: 850643