Skip to content

Commit a13c1e2

Browse files
committed
dont use fsspec for pn_dir files
1 parent fffb426 commit a13c1e2

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

wfdb/io/download.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,11 @@ def _stream_header(file_name: str, pn_dir: str) -> str:
105105
The text contained in the header file
106106
107107
"""
108-
# Full cloud url
109-
if any(pn_dir.startswith(proto) for proto in CLOUD_PROTOCOLS):
110-
url = posixpath.join(pn_dir, file_name)
111-
# Full physionet database url
112-
else:
113-
url = posixpath.join(config.db_index_url, pn_dir, file_name)
108+
# Full url of header location
109+
url = posixpath.join(config.db_index_url, pn_dir, file_name)
114110

115111
# Get the content of the remote file
116-
with fsspec.open(url, "rb") as f:
112+
with _url.openurl(url, "rb") as f:
117113
content = f.read()
118114

119115
return content.decode("iso-8859-1")

0 commit comments

Comments
 (0)