from bkmk_objects import Folder, Bookmark, Ruler
-DEBUG = os.environ.has_key("BKMK_DEBUG")
+DEBUG = "BKMK_DEBUG" in os.environ
if DEBUG:
def debug(note):
def handle_data(self, data):
if data:
if self.charset and default_encoding:
- data = unicode(data, self.charset, "replace").\
+ data = data.decode(self.charset, "replace").\
encode(default_encoding, "xmlcharrefreplace")
self.accumulator += data