Skip to content

Downloads fail on Windows #262

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lbugnon opened this issue Nov 7, 2020 · 5 comments · Fixed by #265
Closed

Downloads fail on Windows #262

lbugnon opened this issue Nov 7, 2020 · 5 comments · Fixed by #265
Assignees
Labels

Comments

@lbugnon
Copy link
Contributor

lbugnon commented Nov 7, 2020

Hi, URL generation is failing in windows when using dl_database, For example

wfdb.dl_database('ltdb', os.path.join("data", "ltdb"))
ValueError: The database https://physionet.org/files/mitdb/1.0.0/1.0.0 has no WFDB files to download

here "/1.0.0" is repeated

@gloryren
Copy link

gloryren commented Nov 9, 2020

same,not solved

@jlnbotello
Copy link

jlnbotello commented Nov 11, 2020

Quick workaround... (could break other db downloads)
Inside "...wfdb\io" edit file "download.py" line 282.
Original

        db_url = posixpath.join(config.db_index_url, db_dir, record.get_version(db_dir))

Modified (version concatenation commented)

        db_url = posixpath.join(config.db_index_url, db_dir )#, record.get_version(db_dir))

@lbugnon
Copy link
Contributor Author

lbugnon commented Nov 12, 2020

The issue is that the os.sep should be replaced with a "/" in the if cited by @jlnbotello, as the url uses / and not \

@jlnbotello
Copy link

jlnbotello commented Nov 12, 2020

You are right @lbugnon !!!

    if '/' not in db_dir:
        db_url = posixpath.join(config.db_index_url, db_dir , record.get_version(db_dir))
    else:
        db_url = posixpath.join(config.db_index_url, db_dir)

Lucas-Mc added a commit that referenced this issue Nov 24, 2020
Replaces `os.sep` with `/` to indicate a URL and prevent issues on Windows machines since `os.sep` on Windows is '\'. Fixes #262.
@Lucas-Mc
Copy link
Contributor

Thanks for the catch @lbugnon! Silly mistake during development which didn't show up on my Mac 🤦 This reminds me and further increases my desire to add Windows OS testing to Travis.. hopefully to be implemented soon!

@Lucas-Mc Lucas-Mc self-assigned this Nov 24, 2020
@Lucas-Mc Lucas-Mc added the bug label Nov 24, 2020
Lucas-Mc added a commit that referenced this issue Nov 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants