Comment 3 for bug 1234114

Revision history for this message
Christian Heimes (heimes) wrote :

It's too late. The imports are resolved when the schema is parsed with xmlschema.xmlSchemaParse() in XMLSchema.__init__(). The code has a comment that explains what is going on:

                # calling xmlSchemaParse on a schema with imports or
                # includes will cause libxml2 to create an internal
                # context for parsing, so push an implied context to route
                # resolve requests to the document's parser
                __GLOBAL_PARSER_CONTEXT.pushImpliedContextFromParser(doc._parser)
                self._c_schema = xmlschema.xmlSchemaParse(parser_ctxt)
                __GLOBAL_PARSER_CONTEXT.popImpliedContext()

You have to disable network access right within the implied context. I have attached a script with a minimal test case.