Skip to content

convert_page fails on windows if page_path contains drive letter #10

@hdkire

Description

@hdkire

convert_page fails on windows when called with paths containing drive letter as page_path because it treats the drive letter of a windows path as an url scheme.

Env:

Python 3.7.2
Windows 10

Repro:

import htmlark
htmlark.convert_page('C:\\page.html')

=>

Traceback (most recent call last):
  File "Python37\lib\site-packages\htmlark.py", line 177, in convert_page
    _, page_text = _get_resource(page_path)
  File "Python37\lib\site-packages\htmlark.py", line 77, in _get_resource
    raise ValueError("Not local path or HTTP/HTTPS URL", url_parsed.scheme)
ValueError: ('Not local path or HTTP/HTTPS URL', 'c')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions