@@ -145,7 +145,7 @@ def _read_pkl(path):
145
145
146
146
@staticmethod
147
147
def _read_txt (path ):
148
- lines = path .read_text ().splitlines ()
148
+ lines = path .read_text (encoding = 'UTF-8' ).splitlines ()
149
149
data = {'file' : str (path )}
150
150
traceback_start = 0
151
151
if lines [0 ].startswith ('Node' ):
@@ -170,27 +170,27 @@ def generate_report(self):
170
170
boiler_idx = 0
171
171
172
172
if (logs_path / 'CITATION.html' ).exists ():
173
- text = (logs_path / 'CITATION.html' ).read_text ()
173
+ text = (logs_path / 'CITATION.html' ).read_text (encoding = 'UTF-8' )
174
174
text = '<div class="boiler-html">%s</div>' % re .compile (
175
175
'<body>(.*?)</body>' ,
176
176
re .DOTALL | re .IGNORECASE ).findall (text )[0 ].strip ()
177
177
boilerplate .append ((boiler_idx , 'HTML' , text ))
178
178
boiler_idx += 1
179
179
180
180
if (logs_path / 'CITATION.md' ).exists ():
181
- text = '<pre>%s</pre>\n ' % (logs_path / 'CITATION.md' ).read_text ()
181
+ text = '<pre>%s</pre>\n ' % (logs_path / 'CITATION.md' ).read_text (encoding = 'UTF-8' )
182
182
boilerplate .append ((boiler_idx , 'Markdown' , text ))
183
183
boiler_idx += 1
184
184
185
185
if (logs_path / 'CITATION.tex' ).exists ():
186
- text = (logs_path / 'CITATION.tex' ).read_text ()
186
+ text = (logs_path / 'CITATION.tex' ).read_text (encoding = 'UTF-8' )
187
187
text = re .compile (
188
188
r'\\begin{document}(.*?)\\end{document}' ,
189
189
re .DOTALL | re .IGNORECASE ).findall (text )[0 ].strip ()
190
190
text = '<pre>%s</pre>\n ' % text
191
191
text += '<h3>Bibliography</h3>\n '
192
192
text += '<pre>%s</pre>\n ' % Path (
193
- pkgrf ('fmriprep' , 'data/boilerplate.bib' )).read_text ()
193
+ pkgrf ('fmriprep' , 'data/boilerplate.bib' )).read_text (encoding = 'UTF-8' )
194
194
boilerplate .append ((boiler_idx , 'LaTeX' , text ))
195
195
boiler_idx += 1
196
196
@@ -204,7 +204,7 @@ def generate_report(self):
204
204
boilerplate = boilerplate )
205
205
206
206
# Write out report
207
- (self .out_dir / 'fmriprep' / self .out_filename ).write_text (report_render )
207
+ (self .out_dir / 'fmriprep' / self .out_filename ).write_text (report_render , encoding = 'UTF-8' )
208
208
return len (self .errors )
209
209
210
210
0 commit comments