Bugs item #1614387, was opened at 2006-12-13 00:24 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1614387&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: XML Group: Platform-specific Status: Open Resolution: None Priority: 5 Private: No Submitted By: Jason Briggs (jrbriggs) Assigned to: Nobody/Anonymous (nobody) Summary: AttributesImpl does not implement __contains__ on Linux Initial Comment: Hi there Had an odd error trying to run a utility called SVGMath: File "/home/jason/downloads/SVGMath-0.3.1/svgmath/mathconfig.py", line 54, in startElement elif u"afm" in attributes: File "/usr/lib/python2.5/site-packages/_xmlplus/sax/xmlreader.py", line 316, in __getitem__ return self._attrs[name] KeyError: 0 It appears that AttributesImpl in the sax package (xmlreader.py) doesn't implement __contains__, so the 'in' operator throws an error. This is on Kubuntu/Linux, so I'm not sure if it's distro-specific or all Linux versions of Python. In any case, if you add: def __contains__(self, name): return self._attrs.has_key(name) to AttributesImpl in xmlreader.py (as per the Windows version of Python), the problem goes away. Kind regards Jason ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1614387&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com