fix bug in modulestore reload: etree parser must be specified explicitly

This commit is contained in:
ichuang
2012-09-02 22:40:50 -04:00
parent 9e8ec09b4d
commit 4341ea7689

View File

@@ -12,6 +12,9 @@ import sys
log = logging.getLogger(__name__)
edx_xml_parser = etree.XMLParser(dtd_validation=False, load_dtd=False,
remove_comments=True, remove_blank_text=True)
def name_to_pathname(name):
"""
Convert a location name for use in a path: replace ':' with '/'.
@@ -146,7 +149,7 @@ class XmlDescriptor(XModuleDescriptor):
Returns an lxml Element
"""
return etree.parse(file_object).getroot()
return etree.parse(file_object, parser=edx_xml_parser).getroot()
@classmethod
def load_file(cls, filepath, fs, location):