Skip to content

Commit

Permalink
encode DOQL response in "UTF-8"
Browse files Browse the repository at this point in the history
  • Loading branch information
buser8304 committed Jan 24, 2019
1 parent c70d0e3 commit ae76dcc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def doql(self):

@staticmethod
def get_list_from_csv(text):
f = StringIO(text.decode("utf-8"))
f = StringIO(text.encode("utf-8", "replace"))
list_ = []
dict_reader = csv.DictReader(f, quotechar='"', delimiter=',', quoting=csv.QUOTE_ALL, skipinitialspace=True, dialect='excel')
for item in dict_reader:
Expand Down Expand Up @@ -121,7 +121,7 @@ def write_inventory_file(groups):
for group in groups:
f.write('[' + group + ']\n')
for device in groups[group]:
f.write(device.encode('ascii', 'replace') + '\n')
f.write(device + '\n')
f.write('\n')

f.close()
Expand Down

0 comments on commit ae76dcc

Please sign in to comment.