X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=wrw%2Fsp%2Fcons.py;h=ff6a1b1b83ebca42185222276b93371ce8ce7007;hb=b339a6776813c92c27e40ec5477d7fe5c3bd38bc;hp=ff0d0afa317547a353cca729858b65852db72484;hpb=85ed5fa5dae0fe236584926824f7292b6e697e76;p=wrw.git diff --git a/wrw/sp/cons.py b/wrw/sp/cons.py index ff0d0af..ff6a1b1 100644 --- a/wrw/sp/cons.py +++ b/wrw/sp/cons.py @@ -40,7 +40,7 @@ class element(node): return self.__todom__(doc).toxml() class context(object): - charset = sys.getfilesystemencoding() + charset = (sys.getfilesystemencoding() or "ascii") def __init__(self): self.nodeconv = {} @@ -60,6 +60,8 @@ class context(object): raise Exception("No node conversion known for %s objects" % str(type(ob))) def addchild(self, node, child): + if child is None: + return node.children.append(self.nodefrom(child)) def addattr(self, node, k, v):