Skip to content
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

unable to create a schema using a UNC file path #246

Closed
MaryMenges opened this issue May 17, 2021 · 2 comments
Closed

unable to create a schema using a UNC file path #246

MaryMenges opened this issue May 17, 2021 · 2 comments

Comments

@MaryMenges
Copy link

Hi,

I'm unable to create a schema using a UNC file path. Local file paths work fine.
Example:

xsd_file_path = '\\host\share\file.xsd'
my_schema = xmlschema.XMLSchema11(xsd_file_path, defuse='always')

Error:
<urlopen error [WinError 3] The system cannot find the path specified: '\\host\\share\\file.xsd'>

It looks like the UNC path is not being normalized correctly. Are UNC paths supported? Is it possible to fix this?

@brunato
Copy link
Member

brunato commented Jun 1, 2021

Hi,
sorry for delay in my response but supporting UNC paths involves a partial rewriting of the url normalization function. I will make this using, whenever possible, the support of pathlib library, so for example with an UNC path it will be:

    url = url.strip()
    if url.startswith('\\'):
        return pathlib.PureWindowsPath(url).as_uri()  # UNC path

@brunato
Copy link
Member

brunato commented Jun 7, 2021

Fixed with release v1.6.3.

@brunato brunato closed this as completed Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants