PLAT-1861 Upgrade to pyfilesystem2

This commit is contained in:
Jeremy Bowman
2017-12-20 11:21:23 -05:00
parent e063a8bdd8
commit 65472399df
18 changed files with 122 additions and 113 deletions

View File

@@ -475,8 +475,8 @@ class XmlParserMixin(object):
# Write the definition to a file
url_path = name_to_pathname(self.url_name)
filepath = self._format_filepath(self.category, url_path)
self.runtime.export_fs.makedir(os.path.dirname(filepath), recursive=True, allow_recreate=True)
with self.runtime.export_fs.open(filepath, 'w') as fileobj:
self.runtime.export_fs.makedirs(os.path.dirname(filepath), recreate=True)
with self.runtime.export_fs.open(filepath, 'wb') as fileobj:
ElementTree(xml_object).write(fileobj, pretty_print=True, encoding='utf-8')
else:
# Write all attributes from xml_object onto node