This is a patch for xml.sax.saxutils.XMLGenerator class. It fixes the ancient bug #847665 - XMLGenerator dies in namespace-aware mode. Technically, the patch defines a function _qname() to write QName from (NSURI, local name) pair, and calls this function where appropriate inside startElementNS()/endElementNS(). The patch is applicable to both maintenance branch (release24-maint) and trunk versions: python/branches/release24-maint/Lib/xml/sax/saxutils.py python/trunk/Lib/xmlcore/sax/saxutils.py More details and a test are available in the bug tracker: http://sourceforge.net/tracker/index.php?func=detail&aid=847665&group_id=5470&atid=105470
Logged In: YES user_id=195108 For convenience, I add a simple test for basic cases. This is for Python 2.4 (it imports xml.sax, rather than xmlcore.sax).