Skip to content

Commit

Permalink
Windows fixes (#185)
Browse files Browse the repository at this point in the history
* utf-8 required to be explicitly set when importing on windows

* Updating version
  • Loading branch information
atbenmurray authored May 24, 2021
1 parent 8ef52e8 commit c0b5f4b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion exetera/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@

__version__ = '0.5.2'
__version__ = '0.5.3'
2 changes: 1 addition & 1 deletion exetera/core/exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def export_to_csv(destination, datastore, fields):
readers = [datastore.get_reader(f[1]) for f in fields]
transforms = [transform_from_reader_type(r) for r in readers]

with open(destination, 'w') as d:
with open(destination, 'w', encoding='utf-8') as d:
csvw = csv.writer(d)
#header
header = [None] * len(fields)
Expand Down
6 changes: 3 additions & 3 deletions exetera/core/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def import_with_schema(timestamp, dest_file_name, schema_file, files, overwrite,
print(schema_file)
print(files)

with open(schema_file) as sf:
with open(schema_file, encoding='utf-8') as sf:
schema = load_schema(sf)

any_parts_present = False
Expand Down Expand Up @@ -73,7 +73,7 @@ def import_with_schema(timestamp, dest_file_name, schema_file, files, overwrite,

fields = schema[sk].fields

with open(files[sk]) as f:
with open(files[sk], encoding='utf-8') as f:
ds = dataset.Dataset(f, stop_after=1)
names = set([n.strip() for n in ds.names_])
missing_names = names.difference(fields.keys())
Expand Down Expand Up @@ -137,7 +137,7 @@ def __init__(self, datastore, source, hf, space, schema, timestamp,
hf.create_group(space)
group = hf[space]

with open(source) as sf:
with open(source, encoding='utf-8') as sf:
csvf = csv.DictReader(sf, delimiter=',', quotechar='"')
# self.names_ = csvf.fieldnames

Expand Down
2 changes: 1 addition & 1 deletion exetera/core/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

DEFAULT_CHUNKSIZE = 1 << 20
INVALID_INDEX = 1 << 62
MAX_DATETIME = datetime(year=9999, month=1, day=1) #.timestamp()
MAX_DATETIME = datetime(year=3000, month=1, day=1) #.timestamp()


def chunks(length, chunksize=1 << 20):
Expand Down

0 comments on commit c0b5f4b

Please sign in to comment.