Skip to content

Commit bbd41a2

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents ff8ef13 + 5c3f7f3 commit bbd41a2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Chapter05/csv_editor.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ def removeRows(self, position, rows, parent):
8585

8686
# method for saving
8787
def save_data(self):
88-
with open(self.filename, 'w', encoding='utf-8') as fh:
88+
# commented out code below to fix issue with additional lines being added after saving csv file from the window.
89+
# with open(self.filename, 'w', encoding='utf-8') as fh:
90+
with open(self.filename, 'w', newline='', encoding='utf-8') as fh:
8991
writer = csv.writer(fh)
9092
writer.writerow(self._headers)
9193
writer.writerows(self._data)

0 commit comments

Comments
 (0)