Skip to content

Commit a7bc5fd

Browse files
author
Benoît HERVIER
authored
UnicodeDecodeError when downloading mghdb
Downloading the mghdb give the following error: UnicodeDecodeError: 'ascii' codec can't decode byte 0xe1 in position 1209: ordinal not in range(128) import wfdb wfdb.dldatabase('mghdb', os.getcwd(), records = 'all', annotators = 'all' , keepsubdirs = True, overwrite = False) It s look like text isn t just ascii, but latin 1.
1 parent e5fb121 commit a7bc5fd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

wfdb/readwrite/downloads.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def streamheader(recordname, pbdir):
1515
r.raise_for_status()
1616

1717
# Get each line as a string
18-
filelines = r.content.decode('ascii').splitlines()
18+
filelines = r.content.decode('iso-8859-1').splitlines()
1919

2020
# Separate content into header and comment lines
2121
headerlines = []

0 commit comments

Comments
 (0)