diff --git a/tableau_documents/tableau_datasource.py b/tableau_documents/tableau_datasource.py index 0a558b8..11073a5 100644 --- a/tableau_documents/tableau_datasource.py +++ b/tableau_documents/tableau_datasource.py @@ -386,7 +386,12 @@ def save_file(self, filename_no_extension, save_to_directory=None): # Write the XML header line lh.write(u"\n\n") # Write the datasource XML itself - lh.write(self.get_datasource_xml()) + ds_string = self.get_datasource_xml() + if type(ds_string, u'bytes'): + final_string = ds_string.decode(u'utf-8') + else: + final_string = ds_string + lh.write(final_string) lh.close() # Handle all of this in the TableauFile object now