From 9741f40579edaa8a0d343847e378c662fd4d7211 Mon Sep 17 00:00:00 2001 From: Nick Macholl Date: Thu, 26 Oct 2023 08:24:28 -0700 Subject: [PATCH] FIX: Windows line endings for symbol mapping tools --- databento/common/symbology.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/databento/common/symbology.py b/databento/common/symbology.py index fdd69ca..f2c0a51 100644 --- a/databento/common/symbology.py +++ b/databento/common/symbology.py @@ -5,7 +5,6 @@ import datetime as dt import functools import json -import os from collections import defaultdict from collections.abc import Mapping from io import TextIOWrapper @@ -452,7 +451,11 @@ def map_symbols_csv( out_fields = (*in_fields, "symbol") with out_file_valid.open("w") as output: - writer = csv.DictWriter(output, fieldnames=out_fields) + writer = csv.DictWriter( + output, + fieldnames=out_fields, + lineterminator="\n", + ) writer.writeheader() for row in reader: @@ -533,7 +536,7 @@ def map_symbols_json( output, separators=(",", ":"), ) - output.write(os.linesep) + output.write("\n") return out_file_valid