Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 558646 - repoman does not check DOCTYPE in metadata.xml when run with python3.4
Summary: repoman does not check DOCTYPE in metadata.xml when run with python3.4
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Repoman (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-25 01:07 UTC by Mike Gilbert
Modified: 2018-02-04 13:31 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Gilbert gentoo-dev 2015-08-25 01:07:58 UTC
repoman uses the following code to build a parser for XML:

class _XMLParser(xml.etree.ElementTree.XMLParser):

    def __init__(self, data, **kwargs):
        xml.etree.ElementTree.XMLParser.__init__(self, **kwargs)
        self._portage_data = data
        if hasattr(self, 'parser'):
            self._base_XmlDeclHandler = self.parser.XmlDeclHandler
            self.parser.XmlDeclHandler = self._portage_XmlDeclHandler
            self._base_StartDoctypeDeclHandler = \
                self.parser.StartDoctypeDeclHandler
            self.parser.StartDoctypeDeclHandler = \
                self._portage_StartDoctypeDeclHandler

With Python 3.4 and expat, xml.etree.ElementTree.XMLParser is really just an alias for _elementtree.XMLParser, which is a C extension module that does not contain a "parser" parser attribute.

This causes hasattr(self, 'parser') to return false, and _portage_StartDoctypeDeclHandler is never installed on the object.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-02-04 13:31:11 UTC
FWICS, the code is no longer there and repoman complains about wrong DTD URI w/ py3.5.