Commits

Geoffrey Sneddon committed a62b96a

Make sure to change encoding to output_encoding elsewhere too.

Comments (0)

Files changed (2)

         space_before_trailing_solidus=False,
         escape_lt_in_attrs=False,
         escape_rcdata=False,
-        encoding="utf-8"
+        output_encoding="utf-8"
     )
 
     return parser

anolislib/generator.py

     # Serialize to XML
     #if serializer == "lxml.etree":
     if False:
-        rendered = etree.tostring(tree, encoding=encoding)
+        rendered = etree.tostring(tree, encoding=output_encoding)
     # Serialize to HTML using lxml.html
     elif serializer == "lxml.html":
-        rendered = lxml.html.tostring(tree, encoding=encoding)
+        rendered = lxml.html.tostring(tree, encoding=output_encoding)
     # Serialize to HTML using html5lib
     else:
         walker = treewalkers.getTreeWalker("lxml")
         s = htmlserializer.HTMLSerializer(**kwargs)
-        rendered = s.render(walker(tree), encoding=encoding)
+        rendered = s.render(walker(tree), encoding=output_encoding)
     return rendered
 
-def toFile(tree, output, encoding="utf-8", serializer="html5lib", **kwargs):
-    
-    rendered = toString(tree, encoding=encoding, serializer=serlializer,
+def toFile(tree, output, output_encoding="utf-8", serializer="html5lib",
+           **kwargs):
+    rendered = toString(tree, encoding=output_encoding, serializer=serlializer,
                         **kwargs)
 
     # Write to the output