Skip to content

Commit 6db8cbf

Browse files
committed
FIX: Convert to unicode from bytestream
1 parent 3285bf5 commit 6db8cbf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

templateflow/api.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,9 @@ def _to_bibtex(doi, template, idx):
333333
)
334334
return doi
335335

336-
return response.text
336+
# doi.org may not honor requested charset, to safeguard force a bytestream with
337+
# response.content, then decode into UTF-8.
338+
return response.content.decode()
337339

338340

339341
def _normalize_ext(value):

0 commit comments

Comments
 (0)