Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions datapaka
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ for filepath in csv_files:
slug = input(" Slug for this file? [%s]" % default_slug)
resource_name = slug or default_slug
with open(filepath, 'rb') as f:
headers = [s.decode("utf-8") for s in f.readline().rstrip('\n').split(',')]
headers = [s.decode("utf-8") for s in f.readline().rstrip(b'\n').split(b',')]
values = csv.reader(f, encoding="utf-8")
print(" Inferring column types, this might take a bit...")
schema = infer(headers, values)
Expand All @@ -157,7 +157,7 @@ for filepath in csv_files:
}
)

out = json.dumps(dp.to_dict(), ensure_ascii=False, encoding='utf-8', indent=2)
out = json.dumps(dp.to_dict(), ensure_ascii=False, indent=2)

if not os.path.exists('datapackage.json'):
outfilename = 'datapackage.json'
Expand Down