Skip to content

Commit 5a9a25f

Browse files
authored
Merge pull request #350 from ajparsons/windows-newline
Resolves issue where CSVs saved in Windows have blank lines
2 parents ba3d46a + 9242551 commit 5a9a25f

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1111

1212
- All code has had black and isort applied. These have been added to Travis.
1313

14+
## Fixed
15+
16+
- Remove extra lines in CSVs under Windows https://github.com/OpenDataServices/flatten-tool/pull/350
17+
1418
## [0.11.0] - 2020-02-21
1519

1620
### Added

flattentool/input.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,7 @@ def merge(base, mergee, debug_info=None):
182182
+ id_info
183183
)
184184
warnings_for_ignored_columns(
185-
v,
186-
"because another column treats it as an array or object".format(
187-
key
188-
),
185+
v, "because another column treats it as an array or object"
189186
)
190187
continue
191188
base_value = base[key].cell_value

flattentool/output.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ def write_sheet(self, sheet_name, sheet):
9090
with open(
9191
os.path.join(self.output_name, self.sheet_prefix + sheet_name + ".csv"),
9292
"w",
93+
newline="",
9394
encoding="utf-8",
9495
) as csv_file:
9596
dictwriter = csv.DictWriter(csv_file, sheet_header)

0 commit comments

Comments
 (0)