From 65330b8c3e2f6f1c7c304082176e48d222f7dfc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fatih=20A=C5=9F=C4=B1c=C4=B1?= Date: Wed, 22 Jun 2011 07:00:12 +0000 Subject: [PATCH] autoxml: Check values against NoneType The expression "value" is also False when the value equals zero. This prevents the presence of the tags with a value of zero. BUG:FIXED:18467 --- pisi/pxml/autoxml.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pisi/pxml/autoxml.py b/pisi/pxml/autoxml.py index ada57a1d..adf05b58 100644 --- a/pisi/pxml/autoxml.py +++ b/pisi/pxml/autoxml.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2005 - 2007, TUBITAK/UEKAE +# Copyright (C) 2005-2011, TUBITAK/UEKAE # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free @@ -662,7 +662,7 @@ class autoxml(oo.autosuper, oo.autoprop): def encode(node, value, errs): """encode given value inside DOM node""" - if value: + if value is not None: writetext(node, token, unicode(value)) else: if req == mandatory: