Skip to content

make no_network configurable #21

@rlskoeser

Description

@rlskoeser

I'd suggest adding it as an argument to the functions that call etree.parse, and then passing it through to that call:

def parseUri(stream, uri=None):
"""Read an XML document from a URI, and return a :mod:`lxml.etree`
document."""
return etree.parse(stream, parser=_get_xmlparser(), base_url=uri)

_loaded_schemas[uri] = etree.XMLSchema(
etree.parse(uri, parser=_get_xmlparser(), base_url=base_uri)
)

It looks like they aren't called by other functions themselves, so I think this should be safe? Could be worth checking if parse is called elsewhere and if etree.fromstring has the same problem.

Originally posted by @blms in #20 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions