Commit 9eeda44d by ichuang

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

parent 3df02d9c
...@@ -12,6 +12,9 @@ import sys ...@@ -12,6 +12,9 @@ import sys
log = logging.getLogger(__name__) 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): def name_to_pathname(name):
""" """
Convert a location name for use in a path: replace ':' with '/'. Convert a location name for use in a path: replace ':' with '/'.
...@@ -146,7 +149,7 @@ class XmlDescriptor(XModuleDescriptor): ...@@ -146,7 +149,7 @@ class XmlDescriptor(XModuleDescriptor):
Returns an lxml Element Returns an lxml Element
""" """
return etree.parse(file_object).getroot() return etree.parse(file_object, parser=edx_xml_parser).getroot()
@classmethod @classmethod
def load_file(cls, filepath, fs, location): def load_file(cls, filepath, fs, location):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment