From: Adam Sampson Date: Mon, 3 Oct 2016 21:38:36 +0000 (+0100) Subject: Specify input and output encodings for tidylib explicitly. X-Git-Tag: v2.22~1 X-Git-Url: http://git.ozo.com/?a=commitdiff_plain;h=29fb9c53118e57c65f4ae5b6b4bb5d1871ee5a35;p=rawdog%2F.git Specify input and output encodings for tidylib explicitly. tidylib 5 -- which Debian now packages -- has changed the default, and this caused the test suite to break in a recent rebuild (bug #839294). --- diff --git a/NEWS b/NEWS index b398346..3491993 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,11 @@ those cases rawdog shouldn't update the URL in the config file. Fix some more style problems reported by pylint. +Specify the input and output character encodings for pytidylib +explicitly. tidylib 5 has changed the defaults from ASCII to UTF-8; +rawdog relies on it being ASCII in order to generate ASCII output +(reported by Lucas Nussbaum). + - rawdog 2.21 Don't crash when asked to show a non-existant template ("-s foo") -- and diff --git a/rawdoglib/rawdog.py b/rawdoglib/rawdog.py index d1d4e4c..8a6702a 100644 --- a/rawdoglib/rawdog.py +++ b/rawdoglib/rawdog.py @@ -136,6 +136,8 @@ def sanitise_html(html, baseurl, inline, config): if config["tidyhtml"]: args = { "numeric_entities": 1, + "input_encoding": "ascii", + "output_encoding": "ascii", "output_html": 1, "output_xhtml": 0, "output_xml": 0,