plaggy commited on
Commit
45b3858
1 Parent(s): 50b0b56

add encoding to open

Browse files
Files changed (1) hide show
  1. prep_scripts/markdown_to_text.py +2 -2
prep_scripts/markdown_to_text.py CHANGED
@@ -49,12 +49,12 @@ def main():
49
  for file in tqdm(files):
50
  parent = file.parent.stem if file.parent.stem != input_dir.stem else ""
51
  if file.is_file():
52
- with open(file) as f:
53
  md = f.read()
54
 
55
  text = markdown_to_text(md)
56
 
57
- with open(output_dir / f"{parent}_{file.stem}.txt", "w") as f:
58
  f.write(text)
59
 
60
 
 
49
  for file in tqdm(files):
50
  parent = file.parent.stem if file.parent.stem != input_dir.stem else ""
51
  if file.is_file():
52
+ with open(file, encoding="utf-8") as f:
53
  md = f.read()
54
 
55
  text = markdown_to_text(md)
56
 
57
+ with open(output_dir / f"{parent}_{file.stem}.txt", "w", encoding="utf-8") as f:
58
  f.write(text)
59
 
60