From 5e566db47d760a649807e1ae2313f5b8bf8de8f0 Mon Sep 17 00:00:00 2001 From: blitzmann Date: Fri, 23 Feb 2018 00:36:52 -0500 Subject: [PATCH] Fix attribute override export / import (#1420) --- gui/propertyEditor.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gui/propertyEditor.py b/gui/propertyEditor.py index 798e1453e..68cc93ee8 100644 --- a/gui/propertyEditor.py +++ b/gui/propertyEditor.py @@ -102,9 +102,11 @@ class AttributeEditor(wx.Frame): style=wx.FD_OPEN | wx.FD_FILE_MUST_EXIST) if dlg.ShowModal() == wx.ID_OK: path = dlg.GetPath() - with open(path, 'rb') as csvfile: + with open(path, 'r') as csvfile: spamreader = csv.reader(csvfile) for row in spamreader: + if len(row) == 0: # csvwriter seems to added blank lines to the end sometimes + continue itemID, attrID, value = row item = getItem(int(itemID)) attr = getAttributeInfo(int(attrID)) @@ -123,7 +125,7 @@ class AttributeEditor(wx.Frame): if dlg.ShowModal() == wx.ID_OK: path = dlg.GetPath() - with open(path, 'wb') as csvfile: + with open(path, 'w', encoding='utf-8') as csvfile: writer = csv.writer(csvfile) for item in items: for key, override in item.overrides.items():