Skip to content

Instantly share code, notes, and snippets.

@jezdez
Created July 14, 2015 08:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jezdez/579e6a30d85c2ced042a to your computer and use it in GitHub Desktop.
Save jezdez/579e6a30d85c2ced042a to your computer and use it in GitHub Desktop.
diff --git a/tidylib/sink.py b/tidylib/sink.py
index 25bc791..2bc7e73 100644
--- a/tidylib/sink.py
+++ b/tidylib/sink.py
@@ -76,7 +76,7 @@ class Sink(object):
def put_byte(sink_id, byte):
# We don't need sink_id because we have a separate put_byte
# function for each sink
- write_func(byte.decode('utf-8'))
+ write_func(byte.decode('utf-8', 'ignore'))
self.struct.putByte = PutByteType(put_byte)
self._as_parameter_ = ctypes.byref(self.struct)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment