shamikbose89 davanstrien HF staff commited on
Commit
c5cd49c
1 Parent(s): dc4e487

open files with latin-1 encoding (#1)

Browse files

- open files with latin-1 encoding (0feb2359a3d02c22db46db0bdbfb292e4eef8c09)


Co-authored-by: Daniel van Strien <davanstrien@users.noreply.huggingface.co>

Files changed (1) hide show
  1. lancaster_newsbooks.py +1 -1
lancaster_newsbooks.py CHANGED
@@ -91,7 +91,7 @@ class LancasterNewsbooks(datasets.GeneratorBasedBuilder):
91
  for subdir in data_dirs:
92
  for file in glob.glob(os.path.join(subdir, "*.xml")):
93
  text_parts = []
94
- with open(file, "r") as fp:
95
  soup = BeautifulSoup(fp, features="xml")
96
  title = soup.find("title").text
97
  id = soup.newsbookDoc.attrs["id"]
 
91
  for subdir in data_dirs:
92
  for file in glob.glob(os.path.join(subdir, "*.xml")):
93
  text_parts = []
94
+ with open(file, "r", encoding="latin-1") as fp:
95
  soup = BeautifulSoup(fp, features="xml")
96
  title = soup.find("title").text
97
  id = soup.newsbookDoc.attrs["id"]