Commit dc8f23d6 by Chris Dodge

the parent directory might not already exist, so we have to call makedir with…

the parent directory might not already exist, so we have to call makedir with recursive=true to auto-create any parent folders
parent bcafc5fd
......@@ -379,7 +379,7 @@ class XmlDescriptor(XModuleDescriptor):
# Write the definition to a file
url_path = name_to_pathname(self.url_name)
filepath = self.__class__._format_filepath(self.category, url_path)
resource_fs.makedir(os.path.dirname(filepath), allow_recreate=True)
resource_fs.makedir(os.path.dirname(filepath), recursive=True, allow_recreate=True)
with resource_fs.open(filepath, 'w') as file:
file.write(etree.tostring(xml_object, pretty_print=True, encoding='utf-8'))
......
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