mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-27 17:44:42 +00:00
ignore output encoding errors
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@1883 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
8cf68dfad4
commit
e6412dd549
1 changed files with 6 additions and 2 deletions
|
|
@ -77,13 +77,17 @@ class Logger (object):
|
|||
self.fd = sys.stdout
|
||||
self.close_fd = False
|
||||
|
||||
def write (self, s):
|
||||
def write (self, s, **args):
|
||||
"""write string to file output"""
|
||||
if self.fd is None:
|
||||
raise ValueError("write to non-file")
|
||||
if not isinstance(s, unicode):
|
||||
raise ValueError("write non-unicode string %r" % s)
|
||||
self.fd.write(s.encode(self.output_encoding, "strict"))
|
||||
self.fd.write(s.encode(self.output_encoding, "ignore"), **args)
|
||||
|
||||
def writeln (self, s=u"", **args):
|
||||
self.write(s)
|
||||
self.write(unicode(os.linesep), **args)
|
||||
|
||||
def has_field (self, name):
|
||||
"""see if given field name will be logged"""
|
||||
|
|
|
|||
Loading…
Reference in a new issue