Repository: internetarchive/openlibrary-client (language: python)

Issue:
running pytest on Windows results in 10 failures
```
(env)
/d/src/ia/openlibrary-client (master)$ pytest
============================= test session starts =============================
platform win32 -- Python 3.9.5, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: D:\src\ia\openlibrary-client, configfile: setup.cfg
plugins: socket-0.5.1
collected 46 items

tests\test_book.py ...                                                   [  6%]
tests\test_bots.py ............                                          [ 32%]
tests\test_openlibrary.py ...F..........FF..FFFF                         [ 80%]
tests\test_utils.py ......                                               [ 93%]
tests\schemata\test_import_schema.py FFF                                 [100%]

================================== FAILURES ===================================
___________________ TestOpenLibrary.test_edition_validation ___________________

self = <jsonschema.validators.RefResolver object at 0x00000249B329D730>
url = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

    def resolve_from_url(self, url):
        """
        Resolve the given remote URL.
        """
        url, fragment = urldefrag(url)
        try:
>           document = self.store[url]

env\lib\site-packages\jsonschema\validators.py:774:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = {'http://json-schema.org/draft-03/schema': {'$schema': 'http://json-schema.org/draft-03/schema#', 'dependencies': {'ex...https://www.loc.gov/marc/languages/', 'properties': {'key': {'type': 'string', 'pattern': '^/languages/[a-z]{3}$'}}}}}}
uri = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

    def __getitem__(self, uri):
>       return self.store[self.normalize(uri)]
E       KeyError: 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

env\lib\site-packages\jsonschema\_utils.py:22: KeyError

During handling of the above exception, another exception occurred:

self = <urllib.request.FileHandler object at 0x00000249B329DB80>
req = <urllib.request.Request object at 0x00000249B329D910>

    def open_local_file(self, req):
        import email.utils
        import mimetypes
        host = req.host
        filename = req.selector
        localfile = url2pathname(filename)
        try:
>           stats = os.stat(localfile)
E           FileNotFoundError: [WinError 3] The system cannot find the path specified: '\\schemata\\shared_definitions.json'

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:1503: FileNotFoundError

During handling of the above exception, another exception occurred:

self = <jsonschema.validators.RefResolver object at 0x00000249B329D730>
url = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

    def resolve_from_url(self, url):
        """
        Resolve the given remote URL.
        """
        url, fragment = urldefrag(url)
        try:
            document = self.store[url]
        except KeyError:
            try:
>               document = self.resolve_remote(url)

env\lib\site-packages\jsonschema\validators.py:777:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <jsonschema.validators.RefResolver object at 0x00000249B329D730>
uri = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

    def resolve_remote(self, uri):
        """
        Resolve a remote ``uri``.

        If called directly, does not check the store first, but after
        retrieving the document at the specified URI it will be saved in
        the store if :attr:`cache_remote` is True.

        .. note::

            If the requests_ library is present, ``jsonschema`` will use it to
            request the remote ``uri``, so that the correct encoding is
            detected and used.

            If it isn't, or if the scheme of the ``uri`` is not ``http`` or
            ``https``, UTF-8 is assumed.

        Arguments:

            uri (str):

                The URI to resolve

        Returns:

            The retrieved document

        .. _requests: https://pypi.org/project/requests/
        """
        try:
            import requests
        except ImportError:
            requests = None

        scheme = urlsplit(uri).scheme

        if scheme in self.handlers:
            result = self.handlers[scheme](uri)
        elif scheme in [u"http", u"https"] and requests:
            # Requests has support for detecting the correct encoding of
            # json over http
            result = requests.get(uri).json()
        else:
            # Otherwise, pass off to urllib and assume utf-8
>           with urlopen(uri) as url:

env\lib\site-packages\jsonschema\validators.py:863:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

url = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'
data = None, timeout = <object object at 0x00000249B04026C0>

    def urlopen(url, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
                *, cafile=None, capath=None, cadefault=False, context=None):
        '''Open the URL url, which can be either a string or a Request object.

        *data* must be an object specifying additional data to be sent to
        the server, or None if no such data is needed.  See Request for
        details.

        urllib.request module uses HTTP/1.1 and includes a "Connection:close"
        header in its HTTP requests.

        The optional *timeout* parameter specifies a timeout in seconds for
        blocking operations like the connection attempt (if not specified, the
        global default timeout setting will be used). This only works for HTTP,
        HTTPS and FTP connections.

        If *context* is specified, it must be a ssl.SSLContext instance describing
        the various SSL options. See HTTPSConnection for more details.

        The optional *cafile* and *capath* parameters specify a set of trusted CA
        certificates for HTTPS requests. cafile should point to a single file
        containing a bundle of CA certificates, whereas capath should point to a
        directory of hashed certificate files. More information can be found in
        ssl.SSLContext.load_verify_locations().

        The *cadefault* parameter is ignored.


        This function always returns an object which can work as a
        context manager and has the properties url, headers, and status.
        See urllib.response.addinfourl for more detail on these properties.

        For HTTP and HTTPS URLs, this function returns a http.client.HTTPResponse
        object slightly modified. In addition to the three new methods above, the
        msg attribute contains the same information as the reason attribute ---
        the reason phrase returned by the server --- instead of the response
        headers as it is specified in the documentation for HTTPResponse.

        For FTP, file, and data URLs and requests explicitly handled by legacy
        URLopener and FancyURLopener classes, this function returns a
        urllib.response.addinfourl object.

        Note that None may be returned if no handler handles the request (though
        the default installed global OpenerDirector uses UnknownHandler to ensure
        this never happens).

        In addition, if proxy settings are detected (for example, when a *_proxy
        environment variable like http_proxy is set), ProxyHandler is default
        installed and makes sure the requests are handled through the proxy.

        '''
        global _opener
        if cafile or capath or cadefault:
            import warnings
            warnings.warn("cafile, capath and cadefault are deprecated, use a "
                          "custom context instead.", DeprecationWarning, 2)
            if context is not None:
                raise ValueError(
                    "You can't pass both context and any of cafile, capath, and "
                    "cadefault"
                )
            if not _have_ssl:
                raise ValueError('SSL support not available')
            context = ssl.create_default_context(ssl.Purpose.SERVER_AUTH,
                                                 cafile=cafile,
                                                 capath=capath)
            https_handler = HTTPSHandler(context=context)
            opener = build_opener(https_handler)
        elif context:
            https_handler = HTTPSHandler(context=context)
            opener = build_opener(https_handler)
        elif _opener is None:
            _opener = opener = build_opener()
        else:
            opener = _opener
>       return opener.open(url, data, timeout)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:214:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.OpenerDirector object at 0x00000249B329D970>
fullurl = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'
data = None, timeout = <object object at 0x00000249B04026C0>

    def open(self, fullurl, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
        # accept a URL or a Request object
        if isinstance(fullurl, str):
            req = Request(fullurl, data)
        else:
            req = fullurl
            if data is not None:
                req.data = data

        req.timeout = timeout
        protocol = req.type

        # pre-process request
        meth_name = protocol+"_request"
        for processor in self.process_request.get(protocol, []):
            meth = getattr(processor, meth_name)
            req = meth(req)

        sys.audit('urllib.Request', req.full_url, req.data, req.headers, req.get_method())
>       response = self._open(req, data)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:517:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.OpenerDirector object at 0x00000249B329D970>
req = <urllib.request.Request object at 0x00000249B329D910>, data = None

    def _open(self, req, data=None):
        result = self._call_chain(self.handle_open, 'default',
                                  'default_open', req)
        if result:
            return result

        protocol = req.type
>       result = self._call_chain(self.handle_open, protocol, protocol +
                                  '_open', req)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:534:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.OpenerDirector object at 0x00000249B329D970>
chain = {'data': [<urllib.request.DataHandler object at 0x00000249B329DC40>], 'file': [<urllib.request.FileHandler object at 0...st.FTPHandler object at 0x00000249B329DB20>], 'http': [<urllib.request.HTTPHandler object at 0x00000249B329DA30>], ...}
kind = 'file', meth_name = 'file_open'
args = (<urllib.request.Request object at 0x00000249B329D910>,)
handlers = [<urllib.request.FileHandler object at 0x00000249B329DB80>]
handler = <urllib.request.FileHandler object at 0x00000249B329DB80>
func = <bound method FileHandler.file_open of <urllib.request.FileHandler object at 0x00000249B329DB80>>

    def _call_chain(self, chain, kind, meth_name, *args):
        # Handlers raise an exception if no one else should try to handle
        # the request, or return None if they can't but another handler
        # could.  Otherwise, they return the response.
        handlers = chain.get(kind, ())
        for handler in handlers:
            func = getattr(handler, meth_name)
>           result = func(*args)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:494:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.FileHandler object at 0x00000249B329DB80>
req = <urllib.request.Request object at 0x00000249B329D910>

    def file_open(self, req):
        url = req.selector
        if url[:2] == '//' and url[2:3] != '/' and (req.host and
                req.host != 'localhost'):
            if not req.host in self.get_names():
                raise URLError("file:// scheme is supported only on localhost")
        else:
>           return self.open_local_file(req)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:1481:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.FileHandler object at 0x00000249B329DB80>
req = <urllib.request.Request object at 0x00000249B329D910>

    def open_local_file(self, req):
        import email.utils
        import mimetypes
        host = req.host
        filename = req.selector
        localfile = url2pathname(filename)
        try:
            stats = os.stat(localfile)
            size = stats.st_size
            modified = email.utils.formatdate(stats.st_mtime, usegmt=True)
            mtype = mimetypes.guess_type(filename)[0]
            headers = email.message_from_string(
                'Content-type: %s\nContent-length: %d\nLast-modified: %s\n' %
                (mtype or 'text/plain', size, modified))
            if host:
                host, port = _splitport(host)
            if not host or \
                (not port and _safe_gethostbyname(host) in self.get_names()):
                if host:
                    origurl = 'file://' + host + filename
                else:
                    origurl = 'file://' + filename
                return addinfourl(open(localfile, 'rb'), headers, origurl)
        except OSError as exp:
>           raise URLError(exp)
E           urllib.error.URLError: <urlopen error [WinError 3] The system cannot find the path specified: '\\schemata\\shared_definitions.json'>

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:1520: URLError

During handling of the above exception, another exception occurred:

self = <tests.test_openlibrary.TestOpenLibrary testMethod=test_edition_validation>

    def test_edition_validation(self):
        author = self.ol.Author('OL123A', 'Test Author')
        edition = self.ol.Edition(
            edition_olid='OL123M',
            work_olid='OL123W',
            title='Test Title',
            type={'key': '/type/edition'},
            revision=1,
            last_modified={
                'type': '/type/datetime',
                'value': '2016-10-12T00:48:04.453554',
            },
            authors=[author],
        )
>       self.assertIsNone(edition.validate())

tests\test_openlibrary.py:244:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
olclient\openlibrary.py:255: in validate
    return self.OL.validate(self, 'edition.schema.json')
olclient\openlibrary.py:108: in validate
    return jsonschema.Draft4Validator(schema, resolver=resolver).validate(
env\lib\site-packages\jsonschema\validators.py:352: in validate
    for error in self.iter_errors(*args, **kwargs):
env\lib\site-packages\jsonschema\validators.py:328: in iter_errors
    for error in errors:
env\lib\site-packages\jsonschema\_validators.py:282: in properties
    for error in validator.descend(
env\lib\site-packages\jsonschema\validators.py:344: in descend
    for error in self.iter_errors(instance, schema):
env\lib\site-packages\jsonschema\validators.py:328: in iter_errors
    for error in errors:
env\lib\site-packages\jsonschema\_validators.py:259: in ref
    scope, resolved = validator.resolver.resolve(ref)
env\lib\site-packages\jsonschema\validators.py:766: in resolve
    return url, self._remote_cache(url)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <jsonschema.validators.RefResolver object at 0x00000249B329D730>
url = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

    def resolve_from_url(self, url):
        """
        Resolve the given remote URL.
        """
        url, fragment = urldefrag(url)
        try:
            document = self.store[url]
        except KeyError:
            try:
                document = self.resolve_remote(url)
            except Exception as exc:
>               raise exceptions.RefResolutionError(exc)
E               jsonschema.exceptions.RefResolutionError: <urlopen error [WinError 3] The system cannot find the path specified: '\\schemata\\shared_definitions.json'>

env\lib\site-packages\jsonschema\validators.py:779: RefResolutionError
____________________ TestOpenLibrary.test_work_validation _____________________

self = <jsonschema.validators.RefResolver object at 0x00000249B33037C0>
url = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

    def resolve_from_url(self, url):
        """
        Resolve the given remote URL.
        """
        url, fragment = urldefrag(url)
        try:
>           document = self.store[url]

env\lib\site-packages\jsonschema\validators.py:774:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = {'http://json-schema.org/draft-03/schema': {'$schema': 'http://json-schema.org/draft-03/schema#', 'dependencies': {'ex...']}}}, 'author': {'$ref': 'shared_definitions.json#/author'}, 'role': {'type': 'string'}, 'as': {'type': 'string'}}}}}}
uri = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

    def __getitem__(self, uri):
>       return self.store[self.normalize(uri)]
E       KeyError: 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

env\lib\site-packages\jsonschema\_utils.py:22: KeyError

During handling of the above exception, another exception occurred:

self = <urllib.request.FileHandler object at 0x00000249B329DB80>
req = <urllib.request.Request object at 0x00000249B3303A00>

    def open_local_file(self, req):
        import email.utils
        import mimetypes
        host = req.host
        filename = req.selector
        localfile = url2pathname(filename)
        try:
>           stats = os.stat(localfile)
E           FileNotFoundError: [WinError 3] The system cannot find the path specified: '\\schemata\\shared_definitions.json'

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:1503: FileNotFoundError

During handling of the above exception, another exception occurred:

self = <jsonschema.validators.RefResolver object at 0x00000249B33037C0>
url = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

    def resolve_from_url(self, url):
        """
        Resolve the given remote URL.
        """
        url, fragment = urldefrag(url)
        try:
            document = self.store[url]
        except KeyError:
            try:
>               document = self.resolve_remote(url)

env\lib\site-packages\jsonschema\validators.py:777:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <jsonschema.validators.RefResolver object at 0x00000249B33037C0>
uri = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

    def resolve_remote(self, uri):
        """
        Resolve a remote ``uri``.

        If called directly, does not check the store first, but after
        retrieving the document at the specified URI it will be saved in
        the store if :attr:`cache_remote` is True.

        .. note::

            If the requests_ library is present, ``jsonschema`` will use it to
            request the remote ``uri``, so that the correct encoding is
            detected and used.

            If it isn't, or if the scheme of the ``uri`` is not ``http`` or
            ``https``, UTF-8 is assumed.

        Arguments:

            uri (str):

                The URI to resolve

        Returns:

            The retrieved document

        .. _requests: https://pypi.org/project/requests/
        """
        try:
            import requests
        except ImportError:
            requests = None

        scheme = urlsplit(uri).scheme

        if scheme in self.handlers:
            result = self.handlers[scheme](uri)
        elif scheme in [u"http", u"https"] and requests:
            # Requests has support for detecting the correct encoding of
            # json over http
            result = requests.get(uri).json()
        else:
            # Otherwise, pass off to urllib and assume utf-8
>           with urlopen(uri) as url:

env\lib\site-packages\jsonschema\validators.py:863:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

url = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'
data = None, timeout = <object object at 0x00000249B04026C0>

    def urlopen(url, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
                *, cafile=None, capath=None, cadefault=False, context=None):
        '''Open the URL url, which can be either a string or a Request object.

        *data* must be an object specifying additional data to be sent to
        the server, or None if no such data is needed.  See Request for
        details.

        urllib.request module uses HTTP/1.1 and includes a "Connection:close"
        header in its HTTP requests.

        The optional *timeout* parameter specifies a timeout in seconds for
        blocking operations like the connection attempt (if not specified, the
        global default timeout setting will be used). This only works for HTTP,
        HTTPS and FTP connections.

        If *context* is specified, it must be a ssl.SSLContext instance describing
        the various SSL options. See HTTPSConnection for more details.

        The optional *cafile* and *capath* parameters specify a set of trusted CA
        certificates for HTTPS requests. cafile should point to a single file
        containing a bundle of CA certificates, whereas capath should point to a
        directory of hashed certificate files. More information can be found in
        ssl.SSLContext.load_verify_locations().

        The *cadefault* parameter is ignored.


        This function always returns an object which can work as a
        context manager and has the properties url, headers, and status.
        See urllib.response.addinfourl for more detail on these properties.

        For HTTP and HTTPS URLs, this function returns a http.client.HTTPResponse
        object slightly modified. In addition to the three new methods above, the
        msg attribute contains the same information as the reason attribute ---
        the reason phrase returned by the server --- instead of the response
        headers as it is specified in the documentation for HTTPResponse.

        For FTP, file, and data URLs and requests explicitly handled by legacy
        URLopener and FancyURLopener classes, this function returns a
        urllib.response.addinfourl object.

        Note that None may be returned if no handler handles the request (though
        the default installed global OpenerDirector uses UnknownHandler to ensure
        this never happens).

        In addition, if proxy settings are detected (for example, when a *_proxy
        environment variable like http_proxy is set), ProxyHandler is default
        installed and makes sure the requests are handled through the proxy.

        '''
        global _opener
        if cafile or capath or cadefault:
            import warnings
            warnings.warn("cafile, capath and cadefault are deprecated, use a "
                          "custom context instead.", DeprecationWarning, 2)
            if context is not None:
                raise ValueError(
                    "You can't pass both context and any of cafile, capath, and "
                    "cadefault"
                )
            if not _have_ssl:
                raise ValueError('SSL support not available')
            context = ssl.create_default_context(ssl.Purpose.SERVER_AUTH,
                                                 cafile=cafile,
                                                 capath=capath)
            https_handler = HTTPSHandler(context=context)
            opener = build_opener(https_handler)
        elif context:
            https_handler = HTTPSHandler(context=context)
            opener = build_opener(https_handler)
        elif _opener is None:
            _opener = opener = build_opener()
        else:
            opener = _opener
>       return opener.open(url, data, timeout)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:214:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.OpenerDirector object at 0x00000249B329D970>
fullurl = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'
data = None, timeout = <object object at 0x00000249B04026C0>

    def open(self, fullurl, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
        # accept a URL or a Request object
        if isinstance(fullurl, str):
            req = Request(fullurl, data)
        else:
            req = fullurl
            if data is not None:
                req.data = data

        req.timeout = timeout
        protocol = req.type

        # pre-process request
        meth_name = protocol+"_request"
        for processor in self.process_request.get(protocol, []):
            meth = getattr(processor, meth_name)
            req = meth(req)

        sys.audit('urllib.Request', req.full_url, req.data, req.headers, req.get_method())
>       response = self._open(req, data)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:517:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.OpenerDirector object at 0x00000249B329D970>
req = <urllib.request.Request object at 0x00000249B3303A00>, data = None

    def _open(self, req, data=None):
        result = self._call_chain(self.handle_open, 'default',
                                  'default_open', req)
        if result:
            return result

        protocol = req.type
>       result = self._call_chain(self.handle_open, protocol, protocol +
                                  '_open', req)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:534:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.OpenerDirector object at 0x00000249B329D970>
chain = {'data': [<urllib.request.DataHandler object at 0x00000249B329DC40>], 'file': [<urllib.request.FileHandler object at 0...st.FTPHandler object at 0x00000249B329DB20>], 'http': [<urllib.request.HTTPHandler object at 0x00000249B329DA30>], ...}
kind = 'file', meth_name = 'file_open'
args = (<urllib.request.Request object at 0x00000249B3303A00>,)
handlers = [<urllib.request.FileHandler object at 0x00000249B329DB80>]
handler = <urllib.request.FileHandler object at 0x00000249B329DB80>
func = <bound method FileHandler.file_open of <urllib.request.FileHandler object at 0x00000249B329DB80>>

    def _call_chain(self, chain, kind, meth_name, *args):
        # Handlers raise an exception if no one else should try to handle
        # the request, or return None if they can't but another handler
        # could.  Otherwise, they return the response.
        handlers = chain.get(kind, ())
        for handler in handlers:
            func = getattr(handler, meth_name)
>           result = func(*args)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:494:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.FileHandler object at 0x00000249B329DB80>
req = <urllib.request.Request object at 0x00000249B3303A00>

    def file_open(self, req):
        url = req.selector
        if url[:2] == '//' and url[2:3] != '/' and (req.host and
                req.host != 'localhost'):
            if not req.host in self.get_names():
                raise URLError("file:// scheme is supported only on localhost")
        else:
>           return self.open_local_file(req)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:1481:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.FileHandler object at 0x00000249B329DB80>
req = <urllib.request.Request object at 0x00000249B3303A00>

    def open_local_file(self, req):
        import email.utils
        import mimetypes
        host = req.host
        filename = req.selector
        localfile = url2pathname(filename)
        try:
            stats = os.stat(localfile)
            size = stats.st_size
            modified = email.utils.formatdate(stats.st_mtime, usegmt=True)
            mtype = mimetypes.guess_type(filename)[0]
            headers = email.message_from_string(
                'Content-type: %s\nContent-length: %d\nLast-modified: %s\n' %
                (mtype or 'text/plain', size, modified))
            if host:
                host, port = _splitport(host)
            if not host or \
                (not port and _safe_gethostbyname(host) in self.get_names()):
                if host:
                    origurl = 'file://' + host + filename
                else:
                    origurl = 'file://' + filename
                return addinfourl(open(localfile, 'rb'), headers, origurl)
        except OSError as exp:
>           raise URLError(exp)
E           urllib.error.URLError: <urlopen error [WinError 3] The system cannot find the path specified: '\\schemata\\shared_definitions.json'>

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:1520: URLError

During handling of the above exception, another exception occurred:

self = <tests.test_openlibrary.TestOpenLibrary testMethod=test_work_validation>

    def test_work_validation(self):
        work = self.ol.Work(
            'OL123W',
            title='Test Title',
            type={'key': '/type/work'},
            revision=1,
            last_modified={
                'type': '/type/datetime',
                'value': '2016-10-12T00:48:04.453554',
            },
        )
>       self.assertIsNone(work.validate())

tests\test_openlibrary.py:208:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
olclient\entity_helpers\work.py:55: in validate
    return self.OL.validate(self, 'work.schema.json')
olclient\openlibrary.py:108: in validate
    return jsonschema.Draft4Validator(schema, resolver=resolver).validate(
env\lib\site-packages\jsonschema\validators.py:352: in validate
    for error in self.iter_errors(*args, **kwargs):
env\lib\site-packages\jsonschema\validators.py:328: in iter_errors
    for error in errors:
env\lib\site-packages\jsonschema\_validators.py:282: in properties
    for error in validator.descend(
env\lib\site-packages\jsonschema\validators.py:344: in descend
    for error in self.iter_errors(instance, schema):
env\lib\site-packages\jsonschema\validators.py:328: in iter_errors
    for error in errors:
env\lib\site-packages\jsonschema\_validators.py:259: in ref
    scope, resolved = validator.resolver.resolve(ref)
env\lib\site-packages\jsonschema\validators.py:766: in resolve
    return url, self._remote_cache(url)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <jsonschema.validators.RefResolver object at 0x00000249B33037C0>
url = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

    def resolve_from_url(self, url):
        """
        Resolve the given remote URL.
        """
        url, fragment = urldefrag(url)
        try:
            document = self.store[url]
        except KeyError:
            try:
                document = self.resolve_remote(url)
            except Exception as exc:
>               raise exceptions.RefResolutionError(exc)
E               jsonschema.exceptions.RefResolutionError: <urlopen error [WinError 3] The system cannot find the path specified: '\\schemata\\shared_definitions.json'>

env\lib\site-packages\jsonschema\validators.py:779: RefResolutionError
_____________________ TestAuthors.test_author_validation ______________________

self = <jsonschema.validators.RefResolver object at 0x00000249B2A46100>
url = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

    def resolve_from_url(self, url):
        """
        Resolve the given remote URL.
        """
        url, fragment = urldefrag(url)
        try:
>           document = self.store[url]

env\lib\site-packages\jsonschema\validators.py:774:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = {'http://json-schema.org/draft-03/schema': {'$schema': 'http://json-schema.org/draft-03/schema#', 'dependencies': {'ex...hared_definitions.json#/internal_datetime'}, 'last_modified': {'$ref': 'shared_definitions.json#/internal_datetime'}}}}
uri = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

    def __getitem__(self, uri):
>       return self.store[self.normalize(uri)]
E       KeyError: 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

env\lib\site-packages\jsonschema\_utils.py:22: KeyError

During handling of the above exception, another exception occurred:

self = <urllib.request.FileHandler object at 0x00000249B329DB80>
req = <urllib.request.Request object at 0x00000249B2A46370>

    def open_local_file(self, req):
        import email.utils
        import mimetypes
        host = req.host
        filename = req.selector
        localfile = url2pathname(filename)
        try:
>           stats = os.stat(localfile)
E           FileNotFoundError: [WinError 3] The system cannot find the path specified: '\\schemata\\shared_definitions.json'

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:1503: FileNotFoundError

During handling of the above exception, another exception occurred:

self = <jsonschema.validators.RefResolver object at 0x00000249B2A46100>
url = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

    def resolve_from_url(self, url):
        """
        Resolve the given remote URL.
        """
        url, fragment = urldefrag(url)
        try:
            document = self.store[url]
        except KeyError:
            try:
>               document = self.resolve_remote(url)

env\lib\site-packages\jsonschema\validators.py:777:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <jsonschema.validators.RefResolver object at 0x00000249B2A46100>
uri = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

    def resolve_remote(self, uri):
        """
        Resolve a remote ``uri``.

        If called directly, does not check the store first, but after
        retrieving the document at the specified URI it will be saved in
        the store if :attr:`cache_remote` is True.

        .. note::

            If the requests_ library is present, ``jsonschema`` will use it to
            request the remote ``uri``, so that the correct encoding is
            detected and used.

            If it isn't, or if the scheme of the ``uri`` is not ``http`` or
            ``https``, UTF-8 is assumed.

        Arguments:

            uri (str):

                The URI to resolve

        Returns:

            The retrieved document

        .. _requests: https://pypi.org/project/requests/
        """
        try:
            import requests
        except ImportError:
            requests = None

        scheme = urlsplit(uri).scheme

        if scheme in self.handlers:
            result = self.handlers[scheme](uri)
        elif scheme in [u"http", u"https"] and requests:
            # Requests has support for detecting the correct encoding of
            # json over http
            result = requests.get(uri).json()
        else:
            # Otherwise, pass off to urllib and assume utf-8
>           with urlopen(uri) as url:

env\lib\site-packages\jsonschema\validators.py:863:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

url = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'
data = None, timeout = <object object at 0x00000249B04026C0>

    def urlopen(url, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
                *, cafile=None, capath=None, cadefault=False, context=None):
        '''Open the URL url, which can be either a string or a Request object.

        *data* must be an object specifying additional data to be sent to
        the server, or None if no such data is needed.  See Request for
        details.

        urllib.request module uses HTTP/1.1 and includes a "Connection:close"
        header in its HTTP requests.

        The optional *timeout* parameter specifies a timeout in seconds for
        blocking operations like the connection attempt (if not specified, the
        global default timeout setting will be used). This only works for HTTP,
        HTTPS and FTP connections.

        If *context* is specified, it must be a ssl.SSLContext instance describing
        the various SSL options. See HTTPSConnection for more details.

        The optional *cafile* and *capath* parameters specify a set of trusted CA
        certificates for HTTPS requests. cafile should point to a single file
        containing a bundle of CA certificates, whereas capath should point to a
        directory of hashed certificate files. More information can be found in
        ssl.SSLContext.load_verify_locations().

        The *cadefault* parameter is ignored.


        This function always returns an object which can work as a
        context manager and has the properties url, headers, and status.
        See urllib.response.addinfourl for more detail on these properties.

        For HTTP and HTTPS URLs, this function returns a http.client.HTTPResponse
        object slightly modified. In addition to the three new methods above, the
        msg attribute contains the same information as the reason attribute ---
        the reason phrase returned by the server --- instead of the response
        headers as it is specified in the documentation for HTTPResponse.

        For FTP, file, and data URLs and requests explicitly handled by legacy
        URLopener and FancyURLopener classes, this function returns a
        urllib.response.addinfourl object.

        Note that None may be returned if no handler handles the request (though
        the default installed global OpenerDirector uses UnknownHandler to ensure
        this never happens).

        In addition, if proxy settings are detected (for example, when a *_proxy
        environment variable like http_proxy is set), ProxyHandler is default
        installed and makes sure the requests are handled through the proxy.

        '''
        global _opener
        if cafile or capath or cadefault:
            import warnings
            warnings.warn("cafile, capath and cadefault are deprecated, use a "
                          "custom context instead.", DeprecationWarning, 2)
            if context is not None:
                raise ValueError(
                    "You can't pass both context and any of cafile, capath, and "
                    "cadefault"
                )
            if not _have_ssl:
                raise ValueError('SSL support not available')
            context = ssl.create_default_context(ssl.Purpose.SERVER_AUTH,
                                                 cafile=cafile,
                                                 capath=capath)
            https_handler = HTTPSHandler(context=context)
            opener = build_opener(https_handler)
        elif context:
            https_handler = HTTPSHandler(context=context)
            opener = build_opener(https_handler)
        elif _opener is None:
            _opener = opener = build_opener()
        else:
            opener = _opener
>       return opener.open(url, data, timeout)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:214:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.OpenerDirector object at 0x00000249B329D970>
fullurl = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'
data = None, timeout = <object object at 0x00000249B04026C0>

    def open(self, fullurl, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
        # accept a URL or a Request object
        if isinstance(fullurl, str):
            req = Request(fullurl, data)
        else:
            req = fullurl
            if data is not None:
                req.data = data

        req.timeout = timeout
        protocol = req.type

        # pre-process request
        meth_name = protocol+"_request"
        for processor in self.process_request.get(protocol, []):
            meth = getattr(processor, meth_name)
            req = meth(req)

        sys.audit('urllib.Request', req.full_url, req.data, req.headers, req.get_method())
>       response = self._open(req, data)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:517:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.OpenerDirector object at 0x00000249B329D970>
req = <urllib.request.Request object at 0x00000249B2A46370>, data = None

    def _open(self, req, data=None):
        result = self._call_chain(self.handle_open, 'default',
                                  'default_open', req)
        if result:
            return result

        protocol = req.type
>       result = self._call_chain(self.handle_open, protocol, protocol +
                                  '_open', req)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:534:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.OpenerDirector object at 0x00000249B329D970>
chain = {'data': [<urllib.request.DataHandler object at 0x00000249B329DC40>], 'file': [<urllib.request.FileHandler object at 0...st.FTPHandler object at 0x00000249B329DB20>], 'http': [<urllib.request.HTTPHandler object at 0x00000249B329DA30>], ...}
kind = 'file', meth_name = 'file_open'
args = (<urllib.request.Request object at 0x00000249B2A46370>,)
handlers = [<urllib.request.FileHandler object at 0x00000249B329DB80>]
handler = <urllib.request.FileHandler object at 0x00000249B329DB80>
func = <bound method FileHandler.file_open of <urllib.request.FileHandler object at 0x00000249B329DB80>>

    def _call_chain(self, chain, kind, meth_name, *args):
        # Handlers raise an exception if no one else should try to handle
        # the request, or return None if they can't but another handler
        # could.  Otherwise, they return the response.
        handlers = chain.get(kind, ())
        for handler in handlers:
            func = getattr(handler, meth_name)
>           result = func(*args)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:494:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.FileHandler object at 0x00000249B329DB80>
req = <urllib.request.Request object at 0x00000249B2A46370>

    def file_open(self, req):
        url = req.selector
        if url[:2] == '//' and url[2:3] != '/' and (req.host and
                req.host != 'localhost'):
            if not req.host in self.get_names():
                raise URLError("file:// scheme is supported only on localhost")
        else:
>           return self.open_local_file(req)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:1481:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.FileHandler object at 0x00000249B329DB80>
req = <urllib.request.Request object at 0x00000249B2A46370>

    def open_local_file(self, req):
        import email.utils
        import mimetypes
        host = req.host
        filename = req.selector
        localfile = url2pathname(filename)
        try:
            stats = os.stat(localfile)
            size = stats.st_size
            modified = email.utils.formatdate(stats.st_mtime, usegmt=True)
            mtype = mimetypes.guess_type(filename)[0]
            headers = email.message_from_string(
                'Content-type: %s\nContent-length: %d\nLast-modified: %s\n' %
                (mtype or 'text/plain', size, modified))
            if host:
                host, port = _splitport(host)
            if not host or \
                (not port and _safe_gethostbyname(host) in self.get_names()):
                if host:
                    origurl = 'file://' + host + filename
                else:
                    origurl = 'file://' + filename
                return addinfourl(open(localfile, 'rb'), headers, origurl)
        except OSError as exp:
>           raise URLError(exp)
E           urllib.error.URLError: <urlopen error [WinError 3] The system cannot find the path specified: '\\schemata\\shared_definitions.json'>

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:1520: URLError

During handling of the above exception, another exception occurred:

self = <tests.test_openlibrary.TestAuthors testMethod=test_author_validation>

    def test_author_validation(self):
        author = self.ol.Author(
            'OL123A',
            name='Test Author',
            revision=1,
            last_modified={
                'type': '/type/datetime',
                'value': '2016-10-12T00:48:04.453554',
            },
        )
>       self.assertIsNone(author.validate())

tests\test_openlibrary.py:306:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
olclient\openlibrary.py:496: in validate
    return self.OL.validate(self, 'author.schema.json')
olclient\openlibrary.py:108: in validate
    return jsonschema.Draft4Validator(schema, resolver=resolver).validate(
env\lib\site-packages\jsonschema\validators.py:352: in validate
    for error in self.iter_errors(*args, **kwargs):
env\lib\site-packages\jsonschema\validators.py:328: in iter_errors
    for error in errors:
env\lib\site-packages\jsonschema\_validators.py:282: in properties
    for error in validator.descend(
env\lib\site-packages\jsonschema\validators.py:344: in descend
    for error in self.iter_errors(instance, schema):
env\lib\site-packages\jsonschema\validators.py:328: in iter_errors
    for error in errors:
env\lib\site-packages\jsonschema\_validators.py:259: in ref
    scope, resolved = validator.resolver.resolve(ref)
env\lib\site-packages\jsonschema\validators.py:766: in resolve
    return url, self._remote_cache(url)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <jsonschema.validators.RefResolver object at 0x00000249B2A46100>
url = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

    def resolve_from_url(self, url):
        """
        Resolve the given remote URL.
        """
        url, fragment = urldefrag(url)
        try:
            document = self.store[url]
        except KeyError:
            try:
                document = self.resolve_remote(url)
            except Exception as exc:
>               raise exceptions.RefResolutionError(exc)
E               jsonschema.exceptions.RefResolutionError: <urlopen error [WinError 3] The system cannot find the path specified: '\\schemata\\shared_definitions.json'>

env\lib\site-packages\jsonschema\validators.py:779: RefResolutionError
_____________________ TestTextType.test_edition_text_type _____________________

self = <jsonschema.validators.RefResolver object at 0x00000249B2A64BE0>
url = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

    def resolve_from_url(self, url):
        """
        Resolve the given remote URL.
        """
        url, fragment = urldefrag(url)
        try:
>           document = self.store[url]

env\lib\site-packages\jsonschema\validators.py:774:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = {'http://json-schema.org/draft-03/schema': {'$schema': 'http://json-schema.org/draft-03/schema#', 'dependencies': {'ex...https://www.loc.gov/marc/languages/', 'properties': {'key': {'type': 'string', 'pattern': '^/languages/[a-z]{3}$'}}}}}}
uri = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

    def __getitem__(self, uri):
>       return self.store[self.normalize(uri)]
E       KeyError: 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

env\lib\site-packages\jsonschema\_utils.py:22: KeyError

During handling of the above exception, another exception occurred:

self = <urllib.request.FileHandler object at 0x00000249B329DB80>
req = <urllib.request.Request object at 0x00000249B2A649A0>

    def open_local_file(self, req):
        import email.utils
        import mimetypes
        host = req.host
        filename = req.selector
        localfile = url2pathname(filename)
        try:
>           stats = os.stat(localfile)
E           FileNotFoundError: [WinError 3] The system cannot find the path specified: '\\schemata\\shared_definitions.json'

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:1503: FileNotFoundError

During handling of the above exception, another exception occurred:

self = <jsonschema.validators.RefResolver object at 0x00000249B2A64BE0>
url = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

    def resolve_from_url(self, url):
        """
        Resolve the given remote URL.
        """
        url, fragment = urldefrag(url)
        try:
            document = self.store[url]
        except KeyError:
            try:
>               document = self.resolve_remote(url)

env\lib\site-packages\jsonschema\validators.py:777:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <jsonschema.validators.RefResolver object at 0x00000249B2A64BE0>
uri = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

    def resolve_remote(self, uri):
        """
        Resolve a remote ``uri``.

        If called directly, does not check the store first, but after
        retrieving the document at the specified URI it will be saved in
        the store if :attr:`cache_remote` is True.

        .. note::

            If the requests_ library is present, ``jsonschema`` will use it to
            request the remote ``uri``, so that the correct encoding is
            detected and used.

            If it isn't, or if the scheme of the ``uri`` is not ``http`` or
            ``https``, UTF-8 is assumed.

        Arguments:

            uri (str):

                The URI to resolve

        Returns:

            The retrieved document

        .. _requests: https://pypi.org/project/requests/
        """
        try:
            import requests
        except ImportError:
            requests = None

        scheme = urlsplit(uri).scheme

        if scheme in self.handlers:
            result = self.handlers[scheme](uri)
        elif scheme in [u"http", u"https"] and requests:
            # Requests has support for detecting the correct encoding of
            # json over http
            result = requests.get(uri).json()
        else:
            # Otherwise, pass off to urllib and assume utf-8
>           with urlopen(uri) as url:

env\lib\site-packages\jsonschema\validators.py:863:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

url = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'
data = None, timeout = <object object at 0x00000249B04026C0>

    def urlopen(url, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
                *, cafile=None, capath=None, cadefault=False, context=None):
        '''Open the URL url, which can be either a string or a Request object.

        *data* must be an object specifying additional data to be sent to
        the server, or None if no such data is needed.  See Request for
        details.

        urllib.request module uses HTTP/1.1 and includes a "Connection:close"
        header in its HTTP requests.

        The optional *timeout* parameter specifies a timeout in seconds for
        blocking operations like the connection attempt (if not specified, the
        global default timeout setting will be used). This only works for HTTP,
        HTTPS and FTP connections.

        If *context* is specified, it must be a ssl.SSLContext instance describing
        the various SSL options. See HTTPSConnection for more details.

        The optional *cafile* and *capath* parameters specify a set of trusted CA
        certificates for HTTPS requests. cafile should point to a single file
        containing a bundle of CA certificates, whereas capath should point to a
        directory of hashed certificate files. More information can be found in
        ssl.SSLContext.load_verify_locations().

        The *cadefault* parameter is ignored.


        This function always returns an object which can work as a
        context manager and has the properties url, headers, and status.
        See urllib.response.addinfourl for more detail on these properties.

        For HTTP and HTTPS URLs, this function returns a http.client.HTTPResponse
        object slightly modified. In addition to the three new methods above, the
        msg attribute contains the same information as the reason attribute ---
        the reason phrase returned by the server --- instead of the response
        headers as it is specified in the documentation for HTTPResponse.

        For FTP, file, and data URLs and requests explicitly handled by legacy
        URLopener and FancyURLopener classes, this function returns a
        urllib.response.addinfourl object.

        Note that None may be returned if no handler handles the request (though
        the default installed global OpenerDirector uses UnknownHandler to ensure
        this never happens).

        In addition, if proxy settings are detected (for example, when a *_proxy
        environment variable like http_proxy is set), ProxyHandler is default
        installed and makes sure the requests are handled through the proxy.

        '''
        global _opener
        if cafile or capath or cadefault:
            import warnings
            warnings.warn("cafile, capath and cadefault are deprecated, use a "
                          "custom context instead.", DeprecationWarning, 2)
            if context is not None:
                raise ValueError(
                    "You can't pass both context and any of cafile, capath, and "
                    "cadefault"
                )
            if not _have_ssl:
                raise ValueError('SSL support not available')
            context = ssl.create_default_context(ssl.Purpose.SERVER_AUTH,
                                                 cafile=cafile,
                                                 capath=capath)
            https_handler = HTTPSHandler(context=context)
            opener = build_opener(https_handler)
        elif context:
            https_handler = HTTPSHandler(context=context)
            opener = build_opener(https_handler)
        elif _opener is None:
            _opener = opener = build_opener()
        else:
            opener = _opener
>       return opener.open(url, data, timeout)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:214:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.OpenerDirector object at 0x00000249B329D970>
fullurl = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'
data = None, timeout = <object object at 0x00000249B04026C0>

    def open(self, fullurl, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
        # accept a URL or a Request object
        if isinstance(fullurl, str):
            req = Request(fullurl, data)
        else:
            req = fullurl
            if data is not None:
                req.data = data

        req.timeout = timeout
        protocol = req.type

        # pre-process request
        meth_name = protocol+"_request"
        for processor in self.process_request.get(protocol, []):
            meth = getattr(processor, meth_name)
            req = meth(req)

        sys.audit('urllib.Request', req.full_url, req.data, req.headers, req.get_method())
>       response = self._open(req, data)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:517:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.OpenerDirector object at 0x00000249B329D970>
req = <urllib.request.Request object at 0x00000249B2A649A0>, data = None

    def _open(self, req, data=None):
        result = self._call_chain(self.handle_open, 'default',
                                  'default_open', req)
        if result:
            return result

        protocol = req.type
>       result = self._call_chain(self.handle_open, protocol, protocol +
                                  '_open', req)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:534:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.OpenerDirector object at 0x00000249B329D970>
chain = {'data': [<urllib.request.DataHandler object at 0x00000249B329DC40>], 'file': [<urllib.request.FileHandler object at 0...st.FTPHandler object at 0x00000249B329DB20>], 'http': [<urllib.request.HTTPHandler object at 0x00000249B329DA30>], ...}
kind = 'file', meth_name = 'file_open'
args = (<urllib.request.Request object at 0x00000249B2A649A0>,)
handlers = [<urllib.request.FileHandler object at 0x00000249B329DB80>]
handler = <urllib.request.FileHandler object at 0x00000249B329DB80>
func = <bound method FileHandler.file_open of <urllib.request.FileHandler object at 0x00000249B329DB80>>

    def _call_chain(self, chain, kind, meth_name, *args):
        # Handlers raise an exception if no one else should try to handle
        # the request, or return None if they can't but another handler
        # could.  Otherwise, they return the response.
        handlers = chain.get(kind, ())
        for handler in handlers:
            func = getattr(handler, meth_name)
>           result = func(*args)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:494:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.FileHandler object at 0x00000249B329DB80>
req = <urllib.request.Request object at 0x00000249B2A649A0>

    def file_open(self, req):
        url = req.selector
        if url[:2] == '//' and url[2:3] != '/' and (req.host and
                req.host != 'localhost'):
            if not req.host in self.get_names():
                raise URLError("file:// scheme is supported only on localhost")
        else:
>           return self.open_local_file(req)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:1481:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.FileHandler object at 0x00000249B329DB80>
req = <urllib.request.Request object at 0x00000249B2A649A0>

    def open_local_file(self, req):
        import email.utils
        import mimetypes
        host = req.host
        filename = req.selector
        localfile = url2pathname(filename)
        try:
            stats = os.stat(localfile)
            size = stats.st_size
            modified = email.utils.formatdate(stats.st_mtime, usegmt=True)
            mtype = mimetypes.guess_type(filename)[0]
            headers = email.message_from_string(
                'Content-type: %s\nContent-length: %d\nLast-modified: %s\n' %
                (mtype or 'text/plain', size, modified))
            if host:
                host, port = _splitport(host)
            if not host or \
                (not port and _safe_gethostbyname(host) in self.get_names()):
                if host:
                    origurl = 'file://' + host + filename
                else:
                    origurl = 'file://' + filename
                return addinfourl(open(localfile, 'rb'), headers, origurl)
        except OSError as exp:
>           raise URLError(exp)
E           urllib.error.URLError: <urlopen error [WinError 3] The system cannot find the path specified: '\\schemata\\shared_definitions.json'>

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:1520: URLError

During handling of the above exception, another exception occurred:

self = <tests.test_openlibrary.TestTextType testMethod=test_edition_text_type>

    def test_edition_text_type(self):
        edition = create_edition(self.ol, **self.texts)
>       self.assertIsNone(edition.validate())

tests\test_openlibrary.py:409:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
olclient\openlibrary.py:255: in validate
    return self.OL.validate(self, 'edition.schema.json')
olclient\openlibrary.py:108: in validate
    return jsonschema.Draft4Validator(schema, resolver=resolver).validate(
env\lib\site-packages\jsonschema\validators.py:352: in validate
    for error in self.iter_errors(*args, **kwargs):
env\lib\site-packages\jsonschema\validators.py:328: in iter_errors
    for error in errors:
env\lib\site-packages\jsonschema\_validators.py:282: in properties
    for error in validator.descend(
env\lib\site-packages\jsonschema\validators.py:344: in descend
    for error in self.iter_errors(instance, schema):
env\lib\site-packages\jsonschema\validators.py:328: in iter_errors
    for error in errors:
env\lib\site-packages\jsonschema\_validators.py:259: in ref
    scope, resolved = validator.resolver.resolve(ref)
env\lib\site-packages\jsonschema\validators.py:766: in resolve
    return url, self._remote_cache(url)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <jsonschema.validators.RefResolver object at 0x00000249B2A64BE0>
url = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

    def resolve_from_url(self, url):
        """
        Resolve the given remote URL.
        """
        url, fragment = urldefrag(url)
        try:
            document = self.store[url]
        except KeyError:
            try:
                document = self.resolve_remote(url)
            except Exception as exc:
>               raise exceptions.RefResolutionError(exc)
E               jsonschema.exceptions.RefResolutionError: <urlopen error [WinError 3] The system cannot find the path specified: '\\schemata\\shared_definitions.json'>

env\lib\site-packages\jsonschema\validators.py:779: RefResolutionError
_______________ TestTextType.test_edition_text_type_from_string _______________

self = <jsonschema.validators.RefResolver object at 0x00000249B36510A0>
url = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

    def resolve_from_url(self, url):
        """
        Resolve the given remote URL.
        """
        url, fragment = urldefrag(url)
        try:
>           document = self.store[url]

env\lib\site-packages\jsonschema\validators.py:774:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = {'http://json-schema.org/draft-03/schema': {'$schema': 'http://json-schema.org/draft-03/schema#', 'dependencies': {'ex...https://www.loc.gov/marc/languages/', 'properties': {'key': {'type': 'string', 'pattern': '^/languages/[a-z]{3}$'}}}}}}
uri = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

    def __getitem__(self, uri):
>       return self.store[self.normalize(uri)]
E       KeyError: 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

env\lib\site-packages\jsonschema\_utils.py:22: KeyError

During handling of the above exception, another exception occurred:

self = <urllib.request.FileHandler object at 0x00000249B329DB80>
req = <urllib.request.Request object at 0x00000249B3651430>

    def open_local_file(self, req):
        import email.utils
        import mimetypes
        host = req.host
        filename = req.selector
        localfile = url2pathname(filename)
        try:
>           stats = os.stat(localfile)
E           FileNotFoundError: [WinError 3] The system cannot find the path specified: '\\schemata\\shared_definitions.json'

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:1503: FileNotFoundError

During handling of the above exception, another exception occurred:

self = <jsonschema.validators.RefResolver object at 0x00000249B36510A0>
url = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

    def resolve_from_url(self, url):
        """
        Resolve the given remote URL.
        """
        url, fragment = urldefrag(url)
        try:
            document = self.store[url]
        except KeyError:
            try:
>               document = self.resolve_remote(url)

env\lib\site-packages\jsonschema\validators.py:777:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <jsonschema.validators.RefResolver object at 0x00000249B36510A0>
uri = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

    def resolve_remote(self, uri):
        """
        Resolve a remote ``uri``.

        If called directly, does not check the store first, but after
        retrieving the document at the specified URI it will be saved in
        the store if :attr:`cache_remote` is True.

        .. note::

            If the requests_ library is present, ``jsonschema`` will use it to
            request the remote ``uri``, so that the correct encoding is
            detected and used.

            If it isn't, or if the scheme of the ``uri`` is not ``http`` or
            ``https``, UTF-8 is assumed.

        Arguments:

            uri (str):

                The URI to resolve

        Returns:

            The retrieved document

        .. _requests: https://pypi.org/project/requests/
        """
        try:
            import requests
        except ImportError:
            requests = None

        scheme = urlsplit(uri).scheme

        if scheme in self.handlers:
            result = self.handlers[scheme](uri)
        elif scheme in [u"http", u"https"] and requests:
            # Requests has support for detecting the correct encoding of
            # json over http
            result = requests.get(uri).json()
        else:
            # Otherwise, pass off to urllib and assume utf-8
>           with urlopen(uri) as url:

env\lib\site-packages\jsonschema\validators.py:863:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

url = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'
data = None, timeout = <object object at 0x00000249B04026C0>

    def urlopen(url, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
                *, cafile=None, capath=None, cadefault=False, context=None):
        '''Open the URL url, which can be either a string or a Request object.

        *data* must be an object specifying additional data to be sent to
        the server, or None if no such data is needed.  See Request for
        details.

        urllib.request module uses HTTP/1.1 and includes a "Connection:close"
        header in its HTTP requests.

        The optional *timeout* parameter specifies a timeout in seconds for
        blocking operations like the connection attempt (if not specified, the
        global default timeout setting will be used). This only works for HTTP,
        HTTPS and FTP connections.

        If *context* is specified, it must be a ssl.SSLContext instance describing
        the various SSL options. See HTTPSConnection for more details.

        The optional *cafile* and *capath* parameters specify a set of trusted CA
        certificates for HTTPS requests. cafile should point to a single file
        containing a bundle of CA certificates, whereas capath should point to a
        directory of hashed certificate files. More information can be found in
        ssl.SSLContext.load_verify_locations().

        The *cadefault* parameter is ignored.


        This function always returns an object which can work as a
        context manager and has the properties url, headers, and status.
        See urllib.response.addinfourl for more detail on these properties.

        For HTTP and HTTPS URLs, this function returns a http.client.HTTPResponse
        object slightly modified. In addition to the three new methods above, the
        msg attribute contains the same information as the reason attribute ---
        the reason phrase returned by the server --- instead of the response
        headers as it is specified in the documentation for HTTPResponse.

        For FTP, file, and data URLs and requests explicitly handled by legacy
        URLopener and FancyURLopener classes, this function returns a
        urllib.response.addinfourl object.

        Note that None may be returned if no handler handles the request (though
        the default installed global OpenerDirector uses UnknownHandler to ensure
        this never happens).

        In addition, if proxy settings are detected (for example, when a *_proxy
        environment variable like http_proxy is set), ProxyHandler is default
        installed and makes sure the requests are handled through the proxy.

        '''
        global _opener
        if cafile or capath or cadefault:
            import warnings
            warnings.warn("cafile, capath and cadefault are deprecated, use a "
                          "custom context instead.", DeprecationWarning, 2)
            if context is not None:
                raise ValueError(
                    "You can't pass both context and any of cafile, capath, and "
                    "cadefault"
                )
            if not _have_ssl:
                raise ValueError('SSL support not available')
            context = ssl.create_default_context(ssl.Purpose.SERVER_AUTH,
                                                 cafile=cafile,
                                                 capath=capath)
            https_handler = HTTPSHandler(context=context)
            opener = build_opener(https_handler)
        elif context:
            https_handler = HTTPSHandler(context=context)
            opener = build_opener(https_handler)
        elif _opener is None:
            _opener = opener = build_opener()
        else:
            opener = _opener
>       return opener.open(url, data, timeout)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:214:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.OpenerDirector object at 0x00000249B329D970>
fullurl = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'
data = None, timeout = <object object at 0x00000249B04026C0>

    def open(self, fullurl, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
        # accept a URL or a Request object
        if isinstance(fullurl, str):
            req = Request(fullurl, data)
        else:
            req = fullurl
            if data is not None:
                req.data = data

        req.timeout = timeout
        protocol = req.type

        # pre-process request
        meth_name = protocol+"_request"
        for processor in self.process_request.get(protocol, []):
            meth = getattr(processor, meth_name)
            req = meth(req)

        sys.audit('urllib.Request', req.full_url, req.data, req.headers, req.get_method())
>       response = self._open(req, data)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:517:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.OpenerDirector object at 0x00000249B329D970>
req = <urllib.request.Request object at 0x00000249B3651430>, data = None

    def _open(self, req, data=None):
        result = self._call_chain(self.handle_open, 'default',
                                  'default_open', req)
        if result:
            return result

        protocol = req.type
>       result = self._call_chain(self.handle_open, protocol, protocol +
                                  '_open', req)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:534:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.OpenerDirector object at 0x00000249B329D970>
chain = {'data': [<urllib.request.DataHandler object at 0x00000249B329DC40>], 'file': [<urllib.request.FileHandler object at 0...st.FTPHandler object at 0x00000249B329DB20>], 'http': [<urllib.request.HTTPHandler object at 0x00000249B329DA30>], ...}
kind = 'file', meth_name = 'file_open'
args = (<urllib.request.Request object at 0x00000249B3651430>,)
handlers = [<urllib.request.FileHandler object at 0x00000249B329DB80>]
handler = <urllib.request.FileHandler object at 0x00000249B329DB80>
func = <bound method FileHandler.file_open of <urllib.request.FileHandler object at 0x00000249B329DB80>>

    def _call_chain(self, chain, kind, meth_name, *args):
        # Handlers raise an exception if no one else should try to handle
        # the request, or return None if they can't but another handler
        # could.  Otherwise, they return the response.
        handlers = chain.get(kind, ())
        for handler in handlers:
            func = getattr(handler, meth_name)
>           result = func(*args)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:494:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.FileHandler object at 0x00000249B329DB80>
req = <urllib.request.Request object at 0x00000249B3651430>

    def file_open(self, req):
        url = req.selector
        if url[:2] == '//' and url[2:3] != '/' and (req.host and
                req.host != 'localhost'):
            if not req.host in self.get_names():
                raise URLError("file:// scheme is supported only on localhost")
        else:
>           return self.open_local_file(req)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:1481:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.FileHandler object at 0x00000249B329DB80>
req = <urllib.request.Request object at 0x00000249B3651430>

    def open_local_file(self, req):
        import email.utils
        import mimetypes
        host = req.host
        filename = req.selector
        localfile = url2pathname(filename)
        try:
            stats = os.stat(localfile)
            size = stats.st_size
            modified = email.utils.formatdate(stats.st_mtime, usegmt=True)
            mtype = mimetypes.guess_type(filename)[0]
            headers = email.message_from_string(
                'Content-type: %s\nContent-length: %d\nLast-modified: %s\n' %
                (mtype or 'text/plain', size, modified))
            if host:
                host, port = _splitport(host)
            if not host or \
                (not port and _safe_gethostbyname(host) in self.get_names()):
                if host:
                    origurl = 'file://' + host + filename
                else:
                    origurl = 'file://' + filename
                return addinfourl(open(localfile, 'rb'), headers, origurl)
        except OSError as exp:
>           raise URLError(exp)
E           urllib.error.URLError: <urlopen error [WinError 3] The system cannot find the path specified: '\\schemata\\shared_definitions.json'>

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:1520: URLError

During handling of the above exception, another exception occurred:

self = <tests.test_openlibrary.TestTextType testMethod=test_edition_text_type_from_string>

    def test_edition_text_type_from_string(self):
        edition = create_edition(self.ol, **self.strings)
>       self.assertIsNone(edition.validate())

tests\test_openlibrary.py:403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
olclient\openlibrary.py:255: in validate
    return self.OL.validate(self, 'edition.schema.json')
olclient\openlibrary.py:108: in validate
    return jsonschema.Draft4Validator(schema, resolver=resolver).validate(
env\lib\site-packages\jsonschema\validators.py:352: in validate
    for error in self.iter_errors(*args, **kwargs):
env\lib\site-packages\jsonschema\validators.py:328: in iter_errors
    for error in errors:
env\lib\site-packages\jsonschema\_validators.py:282: in properties
    for error in validator.descend(
env\lib\site-packages\jsonschema\validators.py:344: in descend
    for error in self.iter_errors(instance, schema):
env\lib\site-packages\jsonschema\validators.py:328: in iter_errors
    for error in errors:
env\lib\site-packages\jsonschema\_validators.py:259: in ref
    scope, resolved = validator.resolver.resolve(ref)
env\lib\site-packages\jsonschema\validators.py:766: in resolve
    return url, self._remote_cache(url)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <jsonschema.validators.RefResolver object at 0x00000249B36510A0>
url = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

    def resolve_from_url(self, url):
        """
        Resolve the given remote URL.
        """
        url, fragment = urldefrag(url)
        try:
            document = self.store[url]
        except KeyError:
            try:
                document = self.resolve_remote(url)
            except Exception as exc:
>               raise exceptions.RefResolutionError(exc)
E               jsonschema.exceptions.RefResolutionError: <urlopen error [WinError 3] The system cannot find the path specified: '\\schemata\\shared_definitions.json'>

env\lib\site-packages\jsonschema\validators.py:779: RefResolutionError
______________________ TestTextType.test_work_text_type _______________________

self = <jsonschema.validators.RefResolver object at 0x00000249B3402340>
url = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

    def resolve_from_url(self, url):
        """
        Resolve the given remote URL.
        """
        url, fragment = urldefrag(url)
        try:
>           document = self.store[url]

env\lib\site-packages\jsonschema\validators.py:774:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = {'http://json-schema.org/draft-03/schema': {'$schema': 'http://json-schema.org/draft-03/schema#', 'dependencies': {'ex...']}}}, 'author': {'$ref': 'shared_definitions.json#/author'}, 'role': {'type': 'string'}, 'as': {'type': 'string'}}}}}}
uri = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

    def __getitem__(self, uri):
>       return self.store[self.normalize(uri)]
E       KeyError: 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

env\lib\site-packages\jsonschema\_utils.py:22: KeyError

During handling of the above exception, another exception occurred:

self = <urllib.request.FileHandler object at 0x00000249B329DB80>
req = <urllib.request.Request object at 0x00000249B3402130>

    def open_local_file(self, req):
        import email.utils
        import mimetypes
        host = req.host
        filename = req.selector
        localfile = url2pathname(filename)
        try:
>           stats = os.stat(localfile)
E           FileNotFoundError: [WinError 3] The system cannot find the path specified: '\\schemata\\shared_definitions.json'

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:1503: FileNotFoundError

During handling of the above exception, another exception occurred:

self = <jsonschema.validators.RefResolver object at 0x00000249B3402340>
url = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

    def resolve_from_url(self, url):
        """
        Resolve the given remote URL.
        """
        url, fragment = urldefrag(url)
        try:
            document = self.store[url]
        except KeyError:
            try:
>               document = self.resolve_remote(url)

env\lib\site-packages\jsonschema\validators.py:777:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <jsonschema.validators.RefResolver object at 0x00000249B3402340>
uri = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

    def resolve_remote(self, uri):
        """
        Resolve a remote ``uri``.

        If called directly, does not check the store first, but after
        retrieving the document at the specified URI it will be saved in
        the store if :attr:`cache_remote` is True.

        .. note::

            If the requests_ library is present, ``jsonschema`` will use it to
            request the remote ``uri``, so that the correct encoding is
            detected and used.

            If it isn't, or if the scheme of the ``uri`` is not ``http`` or
            ``https``, UTF-8 is assumed.

        Arguments:

            uri (str):

                The URI to resolve

        Returns:

            The retrieved document

        .. _requests: https://pypi.org/project/requests/
        """
        try:
            import requests
        except ImportError:
            requests = None

        scheme = urlsplit(uri).scheme

        if scheme in self.handlers:
            result = self.handlers[scheme](uri)
        elif scheme in [u"http", u"https"] and requests:
            # Requests has support for detecting the correct encoding of
            # json over http
            result = requests.get(uri).json()
        else:
            # Otherwise, pass off to urllib and assume utf-8
>           with urlopen(uri) as url:

env\lib\site-packages\jsonschema\validators.py:863:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

url = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'
data = None, timeout = <object object at 0x00000249B04026C0>

    def urlopen(url, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
                *, cafile=None, capath=None, cadefault=False, context=None):
        '''Open the URL url, which can be either a string or a Request object.

        *data* must be an object specifying additional data to be sent to
        the server, or None if no such data is needed.  See Request for
        details.

        urllib.request module uses HTTP/1.1 and includes a "Connection:close"
        header in its HTTP requests.

        The optional *timeout* parameter specifies a timeout in seconds for
        blocking operations like the connection attempt (if not specified, the
        global default timeout setting will be used). This only works for HTTP,
        HTTPS and FTP connections.

        If *context* is specified, it must be a ssl.SSLContext instance describing
        the various SSL options. See HTTPSConnection for more details.

        The optional *cafile* and *capath* parameters specify a set of trusted CA
        certificates for HTTPS requests. cafile should point to a single file
        containing a bundle of CA certificates, whereas capath should point to a
        directory of hashed certificate files. More information can be found in
        ssl.SSLContext.load_verify_locations().

        The *cadefault* parameter is ignored.


        This function always returns an object which can work as a
        context manager and has the properties url, headers, and status.
        See urllib.response.addinfourl for more detail on these properties.

        For HTTP and HTTPS URLs, this function returns a http.client.HTTPResponse
        object slightly modified. In addition to the three new methods above, the
        msg attribute contains the same information as the reason attribute ---
        the reason phrase returned by the server --- instead of the response
        headers as it is specified in the documentation for HTTPResponse.

        For FTP, file, and data URLs and requests explicitly handled by legacy
        URLopener and FancyURLopener classes, this function returns a
        urllib.response.addinfourl object.

        Note that None may be returned if no handler handles the request (though
        the default installed global OpenerDirector uses UnknownHandler to ensure
        this never happens).

        In addition, if proxy settings are detected (for example, when a *_proxy
        environment variable like http_proxy is set), ProxyHandler is default
        installed and makes sure the requests are handled through the proxy.

        '''
        global _opener
        if cafile or capath or cadefault:
            import warnings
            warnings.warn("cafile, capath and cadefault are deprecated, use a "
                          "custom context instead.", DeprecationWarning, 2)
            if context is not None:
                raise ValueError(
                    "You can't pass both context and any of cafile, capath, and "
                    "cadefault"
                )
            if not _have_ssl:
                raise ValueError('SSL support not available')
            context = ssl.create_default_context(ssl.Purpose.SERVER_AUTH,
                                                 cafile=cafile,
                                                 capath=capath)
            https_handler = HTTPSHandler(context=context)
            opener = build_opener(https_handler)
        elif context:
            https_handler = HTTPSHandler(context=context)
            opener = build_opener(https_handler)
        elif _opener is None:
            _opener = opener = build_opener()
        else:
            opener = _opener
>       return opener.open(url, data, timeout)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:214:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.OpenerDirector object at 0x00000249B329D970>
fullurl = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'
data = None, timeout = <object object at 0x00000249B04026C0>

    def open(self, fullurl, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
        # accept a URL or a Request object
        if isinstance(fullurl, str):
            req = Request(fullurl, data)
        else:
            req = fullurl
            if data is not None:
                req.data = data

        req.timeout = timeout
        protocol = req.type

        # pre-process request
        meth_name = protocol+"_request"
        for processor in self.process_request.get(protocol, []):
            meth = getattr(processor, meth_name)
            req = meth(req)

        sys.audit('urllib.Request', req.full_url, req.data, req.headers, req.get_method())
>       response = self._open(req, data)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:517:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.OpenerDirector object at 0x00000249B329D970>
req = <urllib.request.Request object at 0x00000249B3402130>, data = None

    def _open(self, req, data=None):
        result = self._call_chain(self.handle_open, 'default',
                                  'default_open', req)
        if result:
            return result

        protocol = req.type
>       result = self._call_chain(self.handle_open, protocol, protocol +
                                  '_open', req)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:534:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.OpenerDirector object at 0x00000249B329D970>
chain = {'data': [<urllib.request.DataHandler object at 0x00000249B329DC40>], 'file': [<urllib.request.FileHandler object at 0...st.FTPHandler object at 0x00000249B329DB20>], 'http': [<urllib.request.HTTPHandler object at 0x00000249B329DA30>], ...}
kind = 'file', meth_name = 'file_open'
args = (<urllib.request.Request object at 0x00000249B3402130>,)
handlers = [<urllib.request.FileHandler object at 0x00000249B329DB80>]
handler = <urllib.request.FileHandler object at 0x00000249B329DB80>
func = <bound method FileHandler.file_open of <urllib.request.FileHandler object at 0x00000249B329DB80>>

    def _call_chain(self, chain, kind, meth_name, *args):
        # Handlers raise an exception if no one else should try to handle
        # the request, or return None if they can't but another handler
        # could.  Otherwise, they return the response.
        handlers = chain.get(kind, ())
        for handler in handlers:
            func = getattr(handler, meth_name)
>           result = func(*args)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:494:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.FileHandler object at 0x00000249B329DB80>
req = <urllib.request.Request object at 0x00000249B3402130>

    def file_open(self, req):
        url = req.selector
        if url[:2] == '//' and url[2:3] != '/' and (req.host and
                req.host != 'localhost'):
            if not req.host in self.get_names():
                raise URLError("file:// scheme is supported only on localhost")
        else:
>           return self.open_local_file(req)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:1481:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.FileHandler object at 0x00000249B329DB80>
req = <urllib.request.Request object at 0x00000249B3402130>

    def open_local_file(self, req):
        import email.utils
        import mimetypes
        host = req.host
        filename = req.selector
        localfile = url2pathname(filename)
        try:
            stats = os.stat(localfile)
            size = stats.st_size
            modified = email.utils.formatdate(stats.st_mtime, usegmt=True)
            mtype = mimetypes.guess_type(filename)[0]
            headers = email.message_from_string(
                'Content-type: %s\nContent-length: %d\nLast-modified: %s\n' %
                (mtype or 'text/plain', size, modified))
            if host:
                host, port = _splitport(host)
            if not host or \
                (not port and _safe_gethostbyname(host) in self.get_names()):
                if host:
                    origurl = 'file://' + host + filename
                else:
                    origurl = 'file://' + filename
                return addinfourl(open(localfile, 'rb'), headers, origurl)
        except OSError as exp:
>           raise URLError(exp)
E           urllib.error.URLError: <urlopen error [WinError 3] The system cannot find the path specified: '\\schemata\\shared_definitions.json'>

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:1520: URLError

During handling of the above exception, another exception occurred:

self = <tests.test_openlibrary.TestTextType testMethod=test_work_text_type>

    def test_work_text_type(self):
        work = create_work(self.ol, **self.texts)
>       self.assertIsNone(work.validate())

tests\test_openlibrary.py:422:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
olclient\entity_helpers\work.py:55: in validate
    return self.OL.validate(self, 'work.schema.json')
olclient\openlibrary.py:108: in validate
    return jsonschema.Draft4Validator(schema, resolver=resolver).validate(
env\lib\site-packages\jsonschema\validators.py:352: in validate
    for error in self.iter_errors(*args, **kwargs):
env\lib\site-packages\jsonschema\validators.py:328: in iter_errors
    for error in errors:
env\lib\site-packages\jsonschema\_validators.py:282: in properties
    for error in validator.descend(
env\lib\site-packages\jsonschema\validators.py:344: in descend
    for error in self.iter_errors(instance, schema):
env\lib\site-packages\jsonschema\validators.py:328: in iter_errors
    for error in errors:
env\lib\site-packages\jsonschema\_validators.py:259: in ref
    scope, resolved = validator.resolver.resolve(ref)
env\lib\site-packages\jsonschema\validators.py:766: in resolve
    return url, self._remote_cache(url)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <jsonschema.validators.RefResolver object at 0x00000249B3402340>
url = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

    def resolve_from_url(self, url):
        """
        Resolve the given remote URL.
        """
        url, fragment = urldefrag(url)
        try:
            document = self.store[url]
        except KeyError:
            try:
                document = self.resolve_remote(url)
            except Exception as exc:
>               raise exceptions.RefResolutionError(exc)
E               jsonschema.exceptions.RefResolutionError: <urlopen error [WinError 3] The system cannot find the path specified: '\\schemata\\shared_definitions.json'>

env\lib\site-packages\jsonschema\validators.py:779: RefResolutionError
________________ TestTextType.test_work_text_type_from_string _________________

self = <jsonschema.validators.RefResolver object at 0x00000249B343DB20>
url = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

    def resolve_from_url(self, url):
        """
        Resolve the given remote URL.
        """
        url, fragment = urldefrag(url)
        try:
>           document = self.store[url]

env\lib\site-packages\jsonschema\validators.py:774:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = {'http://json-schema.org/draft-03/schema': {'$schema': 'http://json-schema.org/draft-03/schema#', 'dependencies': {'ex...']}}}, 'author': {'$ref': 'shared_definitions.json#/author'}, 'role': {'type': 'string'}, 'as': {'type': 'string'}}}}}}
uri = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

    def __getitem__(self, uri):
>       return self.store[self.normalize(uri)]
E       KeyError: 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

env\lib\site-packages\jsonschema\_utils.py:22: KeyError

During handling of the above exception, another exception occurred:

self = <urllib.request.FileHandler object at 0x00000249B329DB80>
req = <urllib.request.Request object at 0x00000249B33DFD90>

    def open_local_file(self, req):
        import email.utils
        import mimetypes
        host = req.host
        filename = req.selector
        localfile = url2pathname(filename)
        try:
>           stats = os.stat(localfile)
E           FileNotFoundError: [WinError 3] The system cannot find the path specified: '\\schemata\\shared_definitions.json'

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:1503: FileNotFoundError

During handling of the above exception, another exception occurred:

self = <jsonschema.validators.RefResolver object at 0x00000249B343DB20>
url = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

    def resolve_from_url(self, url):
        """
        Resolve the given remote URL.
        """
        url, fragment = urldefrag(url)
        try:
            document = self.store[url]
        except KeyError:
            try:
>               document = self.resolve_remote(url)

env\lib\site-packages\jsonschema\validators.py:777:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <jsonschema.validators.RefResolver object at 0x00000249B343DB20>
uri = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

    def resolve_remote(self, uri):
        """
        Resolve a remote ``uri``.

        If called directly, does not check the store first, but after
        retrieving the document at the specified URI it will be saved in
        the store if :attr:`cache_remote` is True.

        .. note::

            If the requests_ library is present, ``jsonschema`` will use it to
            request the remote ``uri``, so that the correct encoding is
            detected and used.

            If it isn't, or if the scheme of the ``uri`` is not ``http`` or
            ``https``, UTF-8 is assumed.

        Arguments:

            uri (str):

                The URI to resolve

        Returns:

            The retrieved document

        .. _requests: https://pypi.org/project/requests/
        """
        try:
            import requests
        except ImportError:
            requests = None

        scheme = urlsplit(uri).scheme

        if scheme in self.handlers:
            result = self.handlers[scheme](uri)
        elif scheme in [u"http", u"https"] and requests:
            # Requests has support for detecting the correct encoding of
            # json over http
            result = requests.get(uri).json()
        else:
            # Otherwise, pass off to urllib and assume utf-8
>           with urlopen(uri) as url:

env\lib\site-packages\jsonschema\validators.py:863:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

url = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'
data = None, timeout = <object object at 0x00000249B04026C0>

    def urlopen(url, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
                *, cafile=None, capath=None, cadefault=False, context=None):
        '''Open the URL url, which can be either a string or a Request object.

        *data* must be an object specifying additional data to be sent to
        the server, or None if no such data is needed.  See Request for
        details.

        urllib.request module uses HTTP/1.1 and includes a "Connection:close"
        header in its HTTP requests.

        The optional *timeout* parameter specifies a timeout in seconds for
        blocking operations like the connection attempt (if not specified, the
        global default timeout setting will be used). This only works for HTTP,
        HTTPS and FTP connections.

        If *context* is specified, it must be a ssl.SSLContext instance describing
        the various SSL options. See HTTPSConnection for more details.

        The optional *cafile* and *capath* parameters specify a set of trusted CA
        certificates for HTTPS requests. cafile should point to a single file
        containing a bundle of CA certificates, whereas capath should point to a
        directory of hashed certificate files. More information can be found in
        ssl.SSLContext.load_verify_locations().

        The *cadefault* parameter is ignored.


        This function always returns an object which can work as a
        context manager and has the properties url, headers, and status.
        See urllib.response.addinfourl for more detail on these properties.

        For HTTP and HTTPS URLs, this function returns a http.client.HTTPResponse
        object slightly modified. In addition to the three new methods above, the
        msg attribute contains the same information as the reason attribute ---
        the reason phrase returned by the server --- instead of the response
        headers as it is specified in the documentation for HTTPResponse.

        For FTP, file, and data URLs and requests explicitly handled by legacy
        URLopener and FancyURLopener classes, this function returns a
        urllib.response.addinfourl object.

        Note that None may be returned if no handler handles the request (though
        the default installed global OpenerDirector uses UnknownHandler to ensure
        this never happens).

        In addition, if proxy settings are detected (for example, when a *_proxy
        environment variable like http_proxy is set), ProxyHandler is default
        installed and makes sure the requests are handled through the proxy.

        '''
        global _opener
        if cafile or capath or cadefault:
            import warnings
            warnings.warn("cafile, capath and cadefault are deprecated, use a "
                          "custom context instead.", DeprecationWarning, 2)
            if context is not None:
                raise ValueError(
                    "You can't pass both context and any of cafile, capath, and "
                    "cadefault"
                )
            if not _have_ssl:
                raise ValueError('SSL support not available')
            context = ssl.create_default_context(ssl.Purpose.SERVER_AUTH,
                                                 cafile=cafile,
                                                 capath=capath)
            https_handler = HTTPSHandler(context=context)
            opener = build_opener(https_handler)
        elif context:
            https_handler = HTTPSHandler(context=context)
            opener = build_opener(https_handler)
        elif _opener is None:
            _opener = opener = build_opener()
        else:
            opener = _opener
>       return opener.open(url, data, timeout)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:214:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.OpenerDirector object at 0x00000249B329D970>
fullurl = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'
data = None, timeout = <object object at 0x00000249B04026C0>

    def open(self, fullurl, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
        # accept a URL or a Request object
        if isinstance(fullurl, str):
            req = Request(fullurl, data)
        else:
            req = fullurl
            if data is not None:
                req.data = data

        req.timeout = timeout
        protocol = req.type

        # pre-process request
        meth_name = protocol+"_request"
        for processor in self.process_request.get(protocol, []):
            meth = getattr(processor, meth_name)
            req = meth(req)

        sys.audit('urllib.Request', req.full_url, req.data, req.headers, req.get_method())
>       response = self._open(req, data)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:517:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.OpenerDirector object at 0x00000249B329D970>
req = <urllib.request.Request object at 0x00000249B33DFD90>, data = None

    def _open(self, req, data=None):
        result = self._call_chain(self.handle_open, 'default',
                                  'default_open', req)
        if result:
            return result

        protocol = req.type
>       result = self._call_chain(self.handle_open, protocol, protocol +
                                  '_open', req)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:534:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.OpenerDirector object at 0x00000249B329D970>
chain = {'data': [<urllib.request.DataHandler object at 0x00000249B329DC40>], 'file': [<urllib.request.FileHandler object at 0...st.FTPHandler object at 0x00000249B329DB20>], 'http': [<urllib.request.HTTPHandler object at 0x00000249B329DA30>], ...}
kind = 'file', meth_name = 'file_open'
args = (<urllib.request.Request object at 0x00000249B33DFD90>,)
handlers = [<urllib.request.FileHandler object at 0x00000249B329DB80>]
handler = <urllib.request.FileHandler object at 0x00000249B329DB80>
func = <bound method FileHandler.file_open of <urllib.request.FileHandler object at 0x00000249B329DB80>>

    def _call_chain(self, chain, kind, meth_name, *args):
        # Handlers raise an exception if no one else should try to handle
        # the request, or return None if they can't but another handler
        # could.  Otherwise, they return the response.
        handlers = chain.get(kind, ())
        for handler in handlers:
            func = getattr(handler, meth_name)
>           result = func(*args)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:494:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.FileHandler object at 0x00000249B329DB80>
req = <urllib.request.Request object at 0x00000249B33DFD90>

    def file_open(self, req):
        url = req.selector
        if url[:2] == '//' and url[2:3] != '/' and (req.host and
                req.host != 'localhost'):
            if not req.host in self.get_names():
                raise URLError("file:// scheme is supported only on localhost")
        else:
>           return self.open_local_file(req)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:1481:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.FileHandler object at 0x00000249B329DB80>
req = <urllib.request.Request object at 0x00000249B33DFD90>

    def open_local_file(self, req):
        import email.utils
        import mimetypes
        host = req.host
        filename = req.selector
        localfile = url2pathname(filename)
        try:
            stats = os.stat(localfile)
            size = stats.st_size
            modified = email.utils.formatdate(stats.st_mtime, usegmt=True)
            mtype = mimetypes.guess_type(filename)[0]
            headers = email.message_from_string(
                'Content-type: %s\nContent-length: %d\nLast-modified: %s\n' %
                (mtype or 'text/plain', size, modified))
            if host:
                host, port = _splitport(host)
            if not host or \
                (not port and _safe_gethostbyname(host) in self.get_names()):
                if host:
                    origurl = 'file://' + host + filename
                else:
                    origurl = 'file://' + filename
                return addinfourl(open(localfile, 'rb'), headers, origurl)
        except OSError as exp:
>           raise URLError(exp)
E           urllib.error.URLError: <urlopen error [WinError 3] The system cannot find the path specified: '\\schemata\\shared_definitions.json'>

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:1520: URLError

During handling of the above exception, another exception occurred:

self = <tests.test_openlibrary.TestTextType testMethod=test_work_text_type_from_string>

    def test_work_text_type_from_string(self):
        work = create_work(self.ol, **self.strings)
>       self.assertIsNone(work.validate())

tests\test_openlibrary.py:416:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
olclient\entity_helpers\work.py:55: in validate
    return self.OL.validate(self, 'work.schema.json')
olclient\openlibrary.py:108: in validate
    return jsonschema.Draft4Validator(schema, resolver=resolver).validate(
env\lib\site-packages\jsonschema\validators.py:352: in validate
    for error in self.iter_errors(*args, **kwargs):
env\lib\site-packages\jsonschema\validators.py:328: in iter_errors
    for error in errors:
env\lib\site-packages\jsonschema\_validators.py:282: in properties
    for error in validator.descend(
env\lib\site-packages\jsonschema\validators.py:344: in descend
    for error in self.iter_errors(instance, schema):
env\lib\site-packages\jsonschema\validators.py:328: in iter_errors
    for error in errors:
env\lib\site-packages\jsonschema\_validators.py:259: in ref
    scope, resolved = validator.resolver.resolve(ref)
env\lib\site-packages\jsonschema\validators.py:766: in resolve
    return url, self._remote_cache(url)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <jsonschema.validators.RefResolver object at 0x00000249B343DB20>
url = 'file://D:\\src\\ia\\openlibrary-client\\olclient/schemata/shared_definitions.json'

    def resolve_from_url(self, url):
        """
        Resolve the given remote URL.
        """
        url, fragment = urldefrag(url)
        try:
            document = self.store[url]
        except KeyError:
            try:
                document = self.resolve_remote(url)
            except Exception as exc:
>               raise exceptions.RefResolutionError(exc)
E               jsonschema.exceptions.RefResolutionError: <urlopen error [WinError 3] The system cannot find the path specified: '\\schemata\\shared_definitions.json'>

env\lib\site-packages\jsonschema\validators.py:779: RefResolutionError
_______________________ test_import_examples[example0] ________________________

self = <jsonschema.validators.RefResolver object at 0x00000249B3525460>
url = 'file://D:\\src\\ia\\openlibrary-client\\tests\\schemata\\../olclient/schemata/shared_definitions.json'

    def resolve_from_url(self, url):
        """
        Resolve the given remote URL.
        """
        url, fragment = urldefrag(url)
        try:
>           document = self.store[url]

env\lib\site-packages\jsonschema\validators.py:774:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = {'http://json-schema.org/draft-03/schema': {'$schema': 'http://json-schema.org/draft-03/schema#', 'dependencies': {'ex...{'type': 'string', 'enum': ['person', 'org', 'event']}, 'title': {'type': 'string', 'examples': ["duc d'Otrante"]}}}}}}
uri = 'file://D:\\src\\ia\\openlibrary-client\\tests\\schemata\\../olclient/schemata/shared_definitions.json'

    def __getitem__(self, uri):
>       return self.store[self.normalize(uri)]
E       KeyError: 'file://D:\\src\\ia\\openlibrary-client\\tests\\schemata\\../olclient/schemata/shared_definitions.json'

env\lib\site-packages\jsonschema\_utils.py:22: KeyError

During handling of the above exception, another exception occurred:

self = <urllib.request.FileHandler object at 0x00000249B329DB80>
req = <urllib.request.Request object at 0x00000249B35255B0>

    def open_local_file(self, req):
        import email.utils
        import mimetypes
        host = req.host
        filename = req.selector
        localfile = url2pathname(filename)
        try:
>           stats = os.stat(localfile)
E           FileNotFoundError: [WinError 3] The system cannot find the path specified: '\\olclient\\schemata\\shared_definitions.json'

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:1503: FileNotFoundError

During handling of the above exception, another exception occurred:

self = <jsonschema.validators.RefResolver object at 0x00000249B3525460>
url = 'file://D:\\src\\ia\\openlibrary-client\\tests\\schemata\\../olclient/schemata/shared_definitions.json'

    def resolve_from_url(self, url):
        """
        Resolve the given remote URL.
        """
        url, fragment = urldefrag(url)
        try:
            document = self.store[url]
        except KeyError:
            try:
>               document = self.resolve_remote(url)

env\lib\site-packages\jsonschema\validators.py:777:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <jsonschema.validators.RefResolver object at 0x00000249B3525460>
uri = 'file://D:\\src\\ia\\openlibrary-client\\tests\\schemata\\../olclient/schemata/shared_definitions.json'

    def resolve_remote(self, uri):
        """
        Resolve a remote ``uri``.

        If called directly, does not check the store first, but after
        retrieving the document at the specified URI it will be saved in
        the store if :attr:`cache_remote` is True.

        .. note::

            If the requests_ library is present, ``jsonschema`` will use it to
            request the remote ``uri``, so that the correct encoding is
            detected and used.

            If it isn't, or if the scheme of the ``uri`` is not ``http`` or
            ``https``, UTF-8 is assumed.

        Arguments:

            uri (str):

                The URI to resolve

        Returns:

            The retrieved document

        .. _requests: https://pypi.org/project/requests/
        """
        try:
            import requests
        except ImportError:
            requests = None

        scheme = urlsplit(uri).scheme

        if scheme in self.handlers:
            result = self.handlers[scheme](uri)
        elif scheme in [u"http", u"https"] and requests:
            # Requests has support for detecting the correct encoding of
            # json over http
            result = requests.get(uri).json()
        else:
            # Otherwise, pass off to urllib and assume utf-8
>           with urlopen(uri) as url:

env\lib\site-packages\jsonschema\validators.py:863:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

url = 'file://D:\\src\\ia\\openlibrary-client\\tests\\schemata\\../olclient/schemata/shared_definitions.json'
data = None, timeout = <object object at 0x00000249B04026C0>

    def urlopen(url, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
                *, cafile=None, capath=None, cadefault=False, context=None):
        '''Open the URL url, which can be either a string or a Request object.

        *data* must be an object specifying additional data to be sent to
        the server, or None if no such data is needed.  See Request for
        details.

        urllib.request module uses HTTP/1.1 and includes a "Connection:close"
        header in its HTTP requests.

        The optional *timeout* parameter specifies a timeout in seconds for
        blocking operations like the connection attempt (if not specified, the
        global default timeout setting will be used). This only works for HTTP,
        HTTPS and FTP connections.

        If *context* is specified, it must be a ssl.SSLContext instance describing
        the various SSL options. See HTTPSConnection for more details.

        The optional *cafile* and *capath* parameters specify a set of trusted CA
        certificates for HTTPS requests. cafile should point to a single file
        containing a bundle of CA certificates, whereas capath should point to a
        directory of hashed certificate files. More information can be found in
        ssl.SSLContext.load_verify_locations().

        The *cadefault* parameter is ignored.


        This function always returns an object which can work as a
        context manager and has the properties url, headers, and status.
        See urllib.response.addinfourl for more detail on these properties.

        For HTTP and HTTPS URLs, this function returns a http.client.HTTPResponse
        object slightly modified. In addition to the three new methods above, the
        msg attribute contains the same information as the reason attribute ---
        the reason phrase returned by the server --- instead of the response
        headers as it is specified in the documentation for HTTPResponse.

        For FTP, file, and data URLs and requests explicitly handled by legacy
        URLopener and FancyURLopener classes, this function returns a
        urllib.response.addinfourl object.

        Note that None may be returned if no handler handles the request (though
        the default installed global OpenerDirector uses UnknownHandler to ensure
        this never happens).

        In addition, if proxy settings are detected (for example, when a *_proxy
        environment variable like http_proxy is set), ProxyHandler is default
        installed and makes sure the requests are handled through the proxy.

        '''
        global _opener
        if cafile or capath or cadefault:
            import warnings
            warnings.warn("cafile, capath and cadefault are deprecated, use a "
                          "custom context instead.", DeprecationWarning, 2)
            if context is not None:
                raise ValueError(
                    "You can't pass both context and any of cafile, capath, and "
                    "cadefault"
                )
            if not _have_ssl:
                raise ValueError('SSL support not available')
            context = ssl.create_default_context(ssl.Purpose.SERVER_AUTH,
                                                 cafile=cafile,
                                                 capath=capath)
            https_handler = HTTPSHandler(context=context)
            opener = build_opener(https_handler)
        elif context:
            https_handler = HTTPSHandler(context=context)
            opener = build_opener(https_handler)
        elif _opener is None:
            _opener = opener = build_opener()
        else:
            opener = _opener
>       return opener.open(url, data, timeout)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:214:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.OpenerDirector object at 0x00000249B329D970>
fullurl = 'file://D:\\src\\ia\\openlibrary-client\\tests\\schemata\\../olclient/schemata/shared_definitions.json'
data = None, timeout = <object object at 0x00000249B04026C0>

    def open(self, fullurl, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
        # accept a URL or a Request object
        if isinstance(fullurl, str):
            req = Request(fullurl, data)
        else:
            req = fullurl
            if data is not None:
                req.data = data

        req.timeout = timeout
        protocol = req.type

        # pre-process request
        meth_name = protocol+"_request"
        for processor in self.process_request.get(protocol, []):
            meth = getattr(processor, meth_name)
            req = meth(req)

        sys.audit('urllib.Request', req.full_url, req.data, req.headers, req.get_method())
>       response = self._open(req, data)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:517:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.OpenerDirector object at 0x00000249B329D970>
req = <urllib.request.Request object at 0x00000249B35255B0>, data = None

    def _open(self, req, data=None):
        result = self._call_chain(self.handle_open, 'default',
                                  'default_open', req)
        if result:
            return result

        protocol = req.type
>       result = self._call_chain(self.handle_open, protocol, protocol +
                                  '_open', req)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:534:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.OpenerDirector object at 0x00000249B329D970>
chain = {'data': [<urllib.request.DataHandler object at 0x00000249B329DC40>], 'file': [<urllib.request.FileHandler object at 0...st.FTPHandler object at 0x00000249B329DB20>], 'http': [<urllib.request.HTTPHandler object at 0x00000249B329DA30>], ...}
kind = 'file', meth_name = 'file_open'
args = (<urllib.request.Request object at 0x00000249B35255B0>,)
handlers = [<urllib.request.FileHandler object at 0x00000249B329DB80>]
handler = <urllib.request.FileHandler object at 0x00000249B329DB80>
func = <bound method FileHandler.file_open of <urllib.request.FileHandler object at 0x00000249B329DB80>>

    def _call_chain(self, chain, kind, meth_name, *args):
        # Handlers raise an exception if no one else should try to handle
        # the request, or return None if they can't but another handler
        # could.  Otherwise, they return the response.
        handlers = chain.get(kind, ())
        for handler in handlers:
            func = getattr(handler, meth_name)
>           result = func(*args)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:494:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.FileHandler object at 0x00000249B329DB80>
req = <urllib.request.Request object at 0x00000249B35255B0>

    def file_open(self, req):
        url = req.selector
        if url[:2] == '//' and url[2:3] != '/' and (req.host and
                req.host != 'localhost'):
            if not req.host in self.get_names():
                raise URLError("file:// scheme is supported only on localhost")
        else:
>           return self.open_local_file(req)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:1481:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.FileHandler object at 0x00000249B329DB80>
req = <urllib.request.Request object at 0x00000249B35255B0>

    def open_local_file(self, req):
        import email.utils
        import mimetypes
        host = req.host
        filename = req.selector
        localfile = url2pathname(filename)
        try:
            stats = os.stat(localfile)
            size = stats.st_size
            modified = email.utils.formatdate(stats.st_mtime, usegmt=True)
            mtype = mimetypes.guess_type(filename)[0]
            headers = email.message_from_string(
                'Content-type: %s\nContent-length: %d\nLast-modified: %s\n' %
                (mtype or 'text/plain', size, modified))
            if host:
                host, port = _splitport(host)
            if not host or \
                (not port and _safe_gethostbyname(host) in self.get_names()):
                if host:
                    origurl = 'file://' + host + filename
                else:
                    origurl = 'file://' + filename
                return addinfourl(open(localfile, 'rb'), headers, origurl)
        except OSError as exp:
>           raise URLError(exp)
E           urllib.error.URLError: <urlopen error [WinError 3] The system cannot find the path specified: '\\olclient\\schemata\\shared_definitions.json'>

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:1520: URLError

During handling of the above exception, another exception occurred:

example = {'authors': [{'birth_date': '1877', 'death_date': '1947', 'entity_type': 'person', 'name': 'Hardy, G. H.', ...}], 'by_statement': 'by G.H. Hardy', 'edition_name': '3rd ed.', 'languages': ['eng'], ...}

    @pytest.mark.parametrize('example', examples)
    def test_import_examples(example):
        with open(IMPORT_SCHEMA) as schema_data:
            schema = json.load(schema_data)
            resolver = jsonschema.RefResolver('file://' + IMPORT_SCHEMA, schema)
>           result = jsonschema.Draft4Validator(schema, resolver=resolver).validate(example)

tests\schemata\test_import_schema.py:94:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
env\lib\site-packages\jsonschema\validators.py:352: in validate
    for error in self.iter_errors(*args, **kwargs):
env\lib\site-packages\jsonschema\validators.py:328: in iter_errors
    for error in errors:
env\lib\site-packages\jsonschema\_validators.py:282: in properties
    for error in validator.descend(
env\lib\site-packages\jsonschema\validators.py:344: in descend
    for error in self.iter_errors(instance, schema):
env\lib\site-packages\jsonschema\validators.py:328: in iter_errors
    for error in errors:
env\lib\site-packages\jsonschema\_validators.py:259: in ref
    scope, resolved = validator.resolver.resolve(ref)
env\lib\site-packages\jsonschema\validators.py:766: in resolve
    return url, self._remote_cache(url)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <jsonschema.validators.RefResolver object at 0x00000249B3525460>
url = 'file://D:\\src\\ia\\openlibrary-client\\tests\\schemata\\../olclient/schemata/shared_definitions.json'

    def resolve_from_url(self, url):
        """
        Resolve the given remote URL.
        """
        url, fragment = urldefrag(url)
        try:
            document = self.store[url]
        except KeyError:
            try:
                document = self.resolve_remote(url)
            except Exception as exc:
>               raise exceptions.RefResolutionError(exc)
E               jsonschema.exceptions.RefResolutionError: <urlopen error [WinError 3] The system cannot find the path specified: '\\olclient\\schemata\\shared_definitions.json'>

env\lib\site-packages\jsonschema\validators.py:779: RefResolutionError
_______________________ test_import_examples[example1] ________________________

self = <jsonschema.validators.RefResolver object at 0x00000249B2A53670>
url = 'file://D:\\src\\ia\\openlibrary-client\\tests\\schemata\\../olclient/schemata/shared_definitions.json'

    def resolve_from_url(self, url):
        """
        Resolve the given remote URL.
        """
        url, fragment = urldefrag(url)
        try:
>           document = self.store[url]

env\lib\site-packages\jsonschema\validators.py:774:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = {'http://json-schema.org/draft-03/schema': {'$schema': 'http://json-schema.org/draft-03/schema#', 'dependencies': {'ex...{'type': 'string', 'enum': ['person', 'org', 'event']}, 'title': {'type': 'string', 'examples': ["duc d'Otrante"]}}}}}}
uri = 'file://D:\\src\\ia\\openlibrary-client\\tests\\schemata\\../olclient/schemata/shared_definitions.json'

    def __getitem__(self, uri):
>       return self.store[self.normalize(uri)]
E       KeyError: 'file://D:\\src\\ia\\openlibrary-client\\tests\\schemata\\../olclient/schemata/shared_definitions.json'

env\lib\site-packages\jsonschema\_utils.py:22: KeyError

During handling of the above exception, another exception occurred:

self = <urllib.request.FileHandler object at 0x00000249B329DB80>
req = <urllib.request.Request object at 0x00000249B2A539A0>

    def open_local_file(self, req):
        import email.utils
        import mimetypes
        host = req.host
        filename = req.selector
        localfile = url2pathname(filename)
        try:
>           stats = os.stat(localfile)
E           FileNotFoundError: [WinError 3] The system cannot find the path specified: '\\olclient\\schemata\\shared_definitions.json'

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:1503: FileNotFoundError

During handling of the above exception, another exception occurred:

self = <jsonschema.validators.RefResolver object at 0x00000249B2A53670>
url = 'file://D:\\src\\ia\\openlibrary-client\\tests\\schemata\\../olclient/schemata/shared_definitions.json'

    def resolve_from_url(self, url):
        """
        Resolve the given remote URL.
        """
        url, fragment = urldefrag(url)
        try:
            document = self.store[url]
        except KeyError:
            try:
>               document = self.resolve_remote(url)

env\lib\site-packages\jsonschema\validators.py:777:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <jsonschema.validators.RefResolver object at 0x00000249B2A53670>
uri = 'file://D:\\src\\ia\\openlibrary-client\\tests\\schemata\\../olclient/schemata/shared_definitions.json'

    def resolve_remote(self, uri):
        """
        Resolve a remote ``uri``.

        If called directly, does not check the store first, but after
        retrieving the document at the specified URI it will be saved in
        the store if :attr:`cache_remote` is True.

        .. note::

            If the requests_ library is present, ``jsonschema`` will use it to
            request the remote ``uri``, so that the correct encoding is
            detected and used.

            If it isn't, or if the scheme of the ``uri`` is not ``http`` or
            ``https``, UTF-8 is assumed.

        Arguments:

            uri (str):

                The URI to resolve

        Returns:

            The retrieved document

        .. _requests: https://pypi.org/project/requests/
        """
        try:
            import requests
        except ImportError:
            requests = None

        scheme = urlsplit(uri).scheme

        if scheme in self.handlers:
            result = self.handlers[scheme](uri)
        elif scheme in [u"http", u"https"] and requests:
            # Requests has support for detecting the correct encoding of
            # json over http
            result = requests.get(uri).json()
        else:
            # Otherwise, pass off to urllib and assume utf-8
>           with urlopen(uri) as url:

env\lib\site-packages\jsonschema\validators.py:863:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

url = 'file://D:\\src\\ia\\openlibrary-client\\tests\\schemata\\../olclient/schemata/shared_definitions.json'
data = None, timeout = <object object at 0x00000249B04026C0>

    def urlopen(url, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
                *, cafile=None, capath=None, cadefault=False, context=None):
        '''Open the URL url, which can be either a string or a Request object.

        *data* must be an object specifying additional data to be sent to
        the server, or None if no such data is needed.  See Request for
        details.

        urllib.request module uses HTTP/1.1 and includes a "Connection:close"
        header in its HTTP requests.

        The optional *timeout* parameter specifies a timeout in seconds for
        blocking operations like the connection attempt (if not specified, the
        global default timeout setting will be used). This only works for HTTP,
        HTTPS and FTP connections.

        If *context* is specified, it must be a ssl.SSLContext instance describing
        the various SSL options. See HTTPSConnection for more details.

        The optional *cafile* and *capath* parameters specify a set of trusted CA
        certificates for HTTPS requests. cafile should point to a single file
        containing a bundle of CA certificates, whereas capath should point to a
        directory of hashed certificate files. More information can be found in
        ssl.SSLContext.load_verify_locations().

        The *cadefault* parameter is ignored.


        This function always returns an object which can work as a
        context manager and has the properties url, headers, and status.
        See urllib.response.addinfourl for more detail on these properties.

        For HTTP and HTTPS URLs, this function returns a http.client.HTTPResponse
        object slightly modified. In addition to the three new methods above, the
        msg attribute contains the same information as the reason attribute ---
        the reason phrase returned by the server --- instead of the response
        headers as it is specified in the documentation for HTTPResponse.

        For FTP, file, and data URLs and requests explicitly handled by legacy
        URLopener and FancyURLopener classes, this function returns a
        urllib.response.addinfourl object.

        Note that None may be returned if no handler handles the request (though
        the default installed global OpenerDirector uses UnknownHandler to ensure
        this never happens).

        In addition, if proxy settings are detected (for example, when a *_proxy
        environment variable like http_proxy is set), ProxyHandler is default
        installed and makes sure the requests are handled through the proxy.

        '''
        global _opener
        if cafile or capath or cadefault:
            import warnings
            warnings.warn("cafile, capath and cadefault are deprecated, use a "
                          "custom context instead.", DeprecationWarning, 2)
            if context is not None:
                raise ValueError(
                    "You can't pass both context and any of cafile, capath, and "
                    "cadefault"
                )
            if not _have_ssl:
                raise ValueError('SSL support not available')
            context = ssl.create_default_context(ssl.Purpose.SERVER_AUTH,
                                                 cafile=cafile,
                                                 capath=capath)
            https_handler = HTTPSHandler(context=context)
            opener = build_opener(https_handler)
        elif context:
            https_handler = HTTPSHandler(context=context)
            opener = build_opener(https_handler)
        elif _opener is None:
            _opener = opener = build_opener()
        else:
            opener = _opener
>       return opener.open(url, data, timeout)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:214:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.OpenerDirector object at 0x00000249B329D970>
fullurl = 'file://D:\\src\\ia\\openlibrary-client\\tests\\schemata\\../olclient/schemata/shared_definitions.json'
data = None, timeout = <object object at 0x00000249B04026C0>

    def open(self, fullurl, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
        # accept a URL or a Request object
        if isinstance(fullurl, str):
            req = Request(fullurl, data)
        else:
            req = fullurl
            if data is not None:
                req.data = data

        req.timeout = timeout
        protocol = req.type

        # pre-process request
        meth_name = protocol+"_request"
        for processor in self.process_request.get(protocol, []):
            meth = getattr(processor, meth_name)
            req = meth(req)

        sys.audit('urllib.Request', req.full_url, req.data, req.headers, req.get_method())
>       response = self._open(req, data)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:517:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.OpenerDirector object at 0x00000249B329D970>
req = <urllib.request.Request object at 0x00000249B2A539A0>, data = None

    def _open(self, req, data=None):
        result = self._call_chain(self.handle_open, 'default',
                                  'default_open', req)
        if result:
            return result

        protocol = req.type
>       result = self._call_chain(self.handle_open, protocol, protocol +
                                  '_open', req)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:534:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.OpenerDirector object at 0x00000249B329D970>
chain = {'data': [<urllib.request.DataHandler object at 0x00000249B329DC40>], 'file': [<urllib.request.FileHandler object at 0...st.FTPHandler object at 0x00000249B329DB20>], 'http': [<urllib.request.HTTPHandler object at 0x00000249B329DA30>], ...}
kind = 'file', meth_name = 'file_open'
args = (<urllib.request.Request object at 0x00000249B2A539A0>,)
handlers = [<urllib.request.FileHandler object at 0x00000249B329DB80>]
handler = <urllib.request.FileHandler object at 0x00000249B329DB80>
func = <bound method FileHandler.file_open of <urllib.request.FileHandler object at 0x00000249B329DB80>>

    def _call_chain(self, chain, kind, meth_name, *args):
        # Handlers raise an exception if no one else should try to handle
        # the request, or return None if they can't but another handler
        # could.  Otherwise, they return the response.
        handlers = chain.get(kind, ())
        for handler in handlers:
            func = getattr(handler, meth_name)
>           result = func(*args)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:494:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.FileHandler object at 0x00000249B329DB80>
req = <urllib.request.Request object at 0x00000249B2A539A0>

    def file_open(self, req):
        url = req.selector
        if url[:2] == '//' and url[2:3] != '/' and (req.host and
                req.host != 'localhost'):
            if not req.host in self.get_names():
                raise URLError("file:// scheme is supported only on localhost")
        else:
>           return self.open_local_file(req)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:1481:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.FileHandler object at 0x00000249B329DB80>
req = <urllib.request.Request object at 0x00000249B2A539A0>

    def open_local_file(self, req):
        import email.utils
        import mimetypes
        host = req.host
        filename = req.selector
        localfile = url2pathname(filename)
        try:
            stats = os.stat(localfile)
            size = stats.st_size
            modified = email.utils.formatdate(stats.st_mtime, usegmt=True)
            mtype = mimetypes.guess_type(filename)[0]
            headers = email.message_from_string(
                'Content-type: %s\nContent-length: %d\nLast-modified: %s\n' %
                (mtype or 'text/plain', size, modified))
            if host:
                host, port = _splitport(host)
            if not host or \
                (not port and _safe_gethostbyname(host) in self.get_names()):
                if host:
                    origurl = 'file://' + host + filename
                else:
                    origurl = 'file://' + filename
                return addinfourl(open(localfile, 'rb'), headers, origurl)
        except OSError as exp:
>           raise URLError(exp)
E           urllib.error.URLError: <urlopen error [WinError 3] The system cannot find the path specified: '\\olclient\\schemata\\shared_definitions.json'>

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:1520: URLError

During handling of the above exception, another exception occurred:

example = {'authors': [{'birth_date': '1948', 'entity_type': 'person', 'name': 'Gibson, William', 'personal_name': 'Gibson, William'}], 'by_statement': 'William Gibson', 'dewey_decimal_class': ['813/.54'], 'isbn_10': ['0441569595'], ...}

    @pytest.mark.parametrize('example', examples)
    def test_import_examples(example):
        with open(IMPORT_SCHEMA) as schema_data:
            schema = json.load(schema_data)
            resolver = jsonschema.RefResolver('file://' + IMPORT_SCHEMA, schema)
>           result = jsonschema.Draft4Validator(schema, resolver=resolver).validate(example)

tests\schemata\test_import_schema.py:94:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
env\lib\site-packages\jsonschema\validators.py:352: in validate
    for error in self.iter_errors(*args, **kwargs):
env\lib\site-packages\jsonschema\validators.py:328: in iter_errors
    for error in errors:
env\lib\site-packages\jsonschema\_validators.py:282: in properties
    for error in validator.descend(
env\lib\site-packages\jsonschema\validators.py:344: in descend
    for error in self.iter_errors(instance, schema):
env\lib\site-packages\jsonschema\validators.py:328: in iter_errors
    for error in errors:
env\lib\site-packages\jsonschema\_validators.py:259: in ref
    scope, resolved = validator.resolver.resolve(ref)
env\lib\site-packages\jsonschema\validators.py:766: in resolve
    return url, self._remote_cache(url)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <jsonschema.validators.RefResolver object at 0x00000249B2A53670>
url = 'file://D:\\src\\ia\\openlibrary-client\\tests\\schemata\\../olclient/schemata/shared_definitions.json'

    def resolve_from_url(self, url):
        """
        Resolve the given remote URL.
        """
        url, fragment = urldefrag(url)
        try:
            document = self.store[url]
        except KeyError:
            try:
                document = self.resolve_remote(url)
            except Exception as exc:
>               raise exceptions.RefResolutionError(exc)
E               jsonschema.exceptions.RefResolutionError: <urlopen error [WinError 3] The system cannot find the path specified: '\\olclient\\schemata\\shared_definitions.json'>

env\lib\site-packages\jsonschema\validators.py:779: RefResolutionError
_______________________ test_import_examples[example2] ________________________

self = <jsonschema.validators.RefResolver object at 0x00000249B3485670>
url = 'file://D:\\src\\ia\\openlibrary-client\\tests\\schemata\\../olclient/schemata/shared_definitions.json'

    def resolve_from_url(self, url):
        """
        Resolve the given remote URL.
        """
        url, fragment = urldefrag(url)
        try:
>           document = self.store[url]

env\lib\site-packages\jsonschema\validators.py:774:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = {'http://json-schema.org/draft-03/schema': {'$schema': 'http://json-schema.org/draft-03/schema#', 'dependencies': {'ex...{'type': 'string', 'enum': ['person', 'org', 'event']}, 'title': {'type': 'string', 'examples': ["duc d'Otrante"]}}}}}}
uri = 'file://D:\\src\\ia\\openlibrary-client\\tests\\schemata\\../olclient/schemata/shared_definitions.json'

    def __getitem__(self, uri):
>       return self.store[self.normalize(uri)]
E       KeyError: 'file://D:\\src\\ia\\openlibrary-client\\tests\\schemata\\../olclient/schemata/shared_definitions.json'

env\lib\site-packages\jsonschema\_utils.py:22: KeyError

During handling of the above exception, another exception occurred:

self = <urllib.request.FileHandler object at 0x00000249B329DB80>
req = <urllib.request.Request object at 0x00000249B3485430>

    def open_local_file(self, req):
        import email.utils
        import mimetypes
        host = req.host
        filename = req.selector
        localfile = url2pathname(filename)
        try:
>           stats = os.stat(localfile)
E           FileNotFoundError: [WinError 3] The system cannot find the path specified: '\\olclient\\schemata\\shared_definitions.json'

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:1503: FileNotFoundError

During handling of the above exception, another exception occurred:

self = <jsonschema.validators.RefResolver object at 0x00000249B3485670>
url = 'file://D:\\src\\ia\\openlibrary-client\\tests\\schemata\\../olclient/schemata/shared_definitions.json'

    def resolve_from_url(self, url):
        """
        Resolve the given remote URL.
        """
        url, fragment = urldefrag(url)
        try:
            document = self.store[url]
        except KeyError:
            try:
>               document = self.resolve_remote(url)

env\lib\site-packages\jsonschema\validators.py:777:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <jsonschema.validators.RefResolver object at 0x00000249B3485670>
uri = 'file://D:\\src\\ia\\openlibrary-client\\tests\\schemata\\../olclient/schemata/shared_definitions.json'

    def resolve_remote(self, uri):
        """
        Resolve a remote ``uri``.

        If called directly, does not check the store first, but after
        retrieving the document at the specified URI it will be saved in
        the store if :attr:`cache_remote` is True.

        .. note::

            If the requests_ library is present, ``jsonschema`` will use it to
            request the remote ``uri``, so that the correct encoding is
            detected and used.

            If it isn't, or if the scheme of the ``uri`` is not ``http`` or
            ``https``, UTF-8 is assumed.

        Arguments:

            uri (str):

                The URI to resolve

        Returns:

            The retrieved document

        .. _requests: https://pypi.org/project/requests/
        """
        try:
            import requests
        except ImportError:
            requests = None

        scheme = urlsplit(uri).scheme

        if scheme in self.handlers:
            result = self.handlers[scheme](uri)
        elif scheme in [u"http", u"https"] and requests:
            # Requests has support for detecting the correct encoding of
            # json over http
            result = requests.get(uri).json()
        else:
            # Otherwise, pass off to urllib and assume utf-8
>           with urlopen(uri) as url:

env\lib\site-packages\jsonschema\validators.py:863:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

url = 'file://D:\\src\\ia\\openlibrary-client\\tests\\schemata\\../olclient/schemata/shared_definitions.json'
data = None, timeout = <object object at 0x00000249B04026C0>

    def urlopen(url, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
                *, cafile=None, capath=None, cadefault=False, context=None):
        '''Open the URL url, which can be either a string or a Request object.

        *data* must be an object specifying additional data to be sent to
        the server, or None if no such data is needed.  See Request for
        details.

        urllib.request module uses HTTP/1.1 and includes a "Connection:close"
        header in its HTTP requests.

        The optional *timeout* parameter specifies a timeout in seconds for
        blocking operations like the connection attempt (if not specified, the
        global default timeout setting will be used). This only works for HTTP,
        HTTPS and FTP connections.

        If *context* is specified, it must be a ssl.SSLContext instance describing
        the various SSL options. See HTTPSConnection for more details.

        The optional *cafile* and *capath* parameters specify a set of trusted CA
        certificates for HTTPS requests. cafile should point to a single file
        containing a bundle of CA certificates, whereas capath should point to a
        directory of hashed certificate files. More information can be found in
        ssl.SSLContext.load_verify_locations().

        The *cadefault* parameter is ignored.


        This function always returns an object which can work as a
        context manager and has the properties url, headers, and status.
        See urllib.response.addinfourl for more detail on these properties.

        For HTTP and HTTPS URLs, this function returns a http.client.HTTPResponse
        object slightly modified. In addition to the three new methods above, the
        msg attribute contains the same information as the reason attribute ---
        the reason phrase returned by the server --- instead of the response
        headers as it is specified in the documentation for HTTPResponse.

        For FTP, file, and data URLs and requests explicitly handled by legacy
        URLopener and FancyURLopener classes, this function returns a
        urllib.response.addinfourl object.

        Note that None may be returned if no handler handles the request (though
        the default installed global OpenerDirector uses UnknownHandler to ensure
        this never happens).

        In addition, if proxy settings are detected (for example, when a *_proxy
        environment variable like http_proxy is set), ProxyHandler is default
        installed and makes sure the requests are handled through the proxy.

        '''
        global _opener
        if cafile or capath or cadefault:
            import warnings
            warnings.warn("cafile, capath and cadefault are deprecated, use a "
                          "custom context instead.", DeprecationWarning, 2)
            if context is not None:
                raise ValueError(
                    "You can't pass both context and any of cafile, capath, and "
                    "cadefault"
                )
            if not _have_ssl:
                raise ValueError('SSL support not available')
            context = ssl.create_default_context(ssl.Purpose.SERVER_AUTH,
                                                 cafile=cafile,
                                                 capath=capath)
            https_handler = HTTPSHandler(context=context)
            opener = build_opener(https_handler)
        elif context:
            https_handler = HTTPSHandler(context=context)
            opener = build_opener(https_handler)
        elif _opener is None:
            _opener = opener = build_opener()
        else:
            opener = _opener
>       return opener.open(url, data, timeout)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:214:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.OpenerDirector object at 0x00000249B329D970>
fullurl = 'file://D:\\src\\ia\\openlibrary-client\\tests\\schemata\\../olclient/schemata/shared_definitions.json'
data = None, timeout = <object object at 0x00000249B04026C0>

    def open(self, fullurl, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
        # accept a URL or a Request object
        if isinstance(fullurl, str):
            req = Request(fullurl, data)
        else:
            req = fullurl
            if data is not None:
                req.data = data

        req.timeout = timeout
        protocol = req.type

        # pre-process request
        meth_name = protocol+"_request"
        for processor in self.process_request.get(protocol, []):
            meth = getattr(processor, meth_name)
            req = meth(req)

        sys.audit('urllib.Request', req.full_url, req.data, req.headers, req.get_method())
>       response = self._open(req, data)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:517:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.OpenerDirector object at 0x00000249B329D970>
req = <urllib.request.Request object at 0x00000249B3485430>, data = None

    def _open(self, req, data=None):
        result = self._call_chain(self.handle_open, 'default',
                                  'default_open', req)
        if result:
            return result

        protocol = req.type
>       result = self._call_chain(self.handle_open, protocol, protocol +
                                  '_open', req)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:534:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.OpenerDirector object at 0x00000249B329D970>
chain = {'data': [<urllib.request.DataHandler object at 0x00000249B329DC40>], 'file': [<urllib.request.FileHandler object at 0...st.FTPHandler object at 0x00000249B329DB20>], 'http': [<urllib.request.HTTPHandler object at 0x00000249B329DA30>], ...}
kind = 'file', meth_name = 'file_open'
args = (<urllib.request.Request object at 0x00000249B3485430>,)
handlers = [<urllib.request.FileHandler object at 0x00000249B329DB80>]
handler = <urllib.request.FileHandler object at 0x00000249B329DB80>
func = <bound method FileHandler.file_open of <urllib.request.FileHandler object at 0x00000249B329DB80>>

    def _call_chain(self, chain, kind, meth_name, *args):
        # Handlers raise an exception if no one else should try to handle
        # the request, or return None if they can't but another handler
        # could.  Otherwise, they return the response.
        handlers = chain.get(kind, ())
        for handler in handlers:
            func = getattr(handler, meth_name)
>           result = func(*args)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:494:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.FileHandler object at 0x00000249B329DB80>
req = <urllib.request.Request object at 0x00000249B3485430>

    def file_open(self, req):
        url = req.selector
        if url[:2] == '//' and url[2:3] != '/' and (req.host and
                req.host != 'localhost'):
            if not req.host in self.get_names():
                raise URLError("file:// scheme is supported only on localhost")
        else:
>           return self.open_local_file(req)

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:1481:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.FileHandler object at 0x00000249B329DB80>
req = <urllib.request.Request object at 0x00000249B3485430>

    def open_local_file(self, req):
        import email.utils
        import mimetypes
        host = req.host
        filename = req.selector
        localfile = url2pathname(filename)
        try:
            stats = os.stat(localfile)
            size = stats.st_size
            modified = email.utils.formatdate(stats.st_mtime, usegmt=True)
            mtype = mimetypes.guess_type(filename)[0]
            headers = email.message_from_string(
                'Content-type: %s\nContent-length: %d\nLast-modified: %s\n' %
                (mtype or 'text/plain', size, modified))
            if host:
                host, port = _splitport(host)
            if not host or \
                (not port and _safe_gethostbyname(host) in self.get_names()):
                if host:
                    origurl = 'file://' + host + filename
                else:
                    origurl = 'file://' + filename
                return addinfourl(open(localfile, 'rb'), headers, origurl)
        except OSError as exp:
>           raise URLError(exp)
E           urllib.error.URLError: <urlopen error [WinError 3] The system cannot find the path specified: '\\olclient\\schemata\\shared_definitions.json'>

c:\users\migno\appdata\local\programs\python\python39\lib\urllib\request.py:1520: URLError

During handling of the above exception, another exception occurred:

example = {'authors': [{'birth_date': '1894', 'entity_type': 'person', 'name': 'Hubbard, Freeman H.', 'personal_name': 'Hubbard, Freeman H.'}], 'by_statement': 'Illustrated by Herb Mott', 'dewey_decimal_class': ['625.2'], 'languages': ['eng'], ...}

    @pytest.mark.parametrize('example', examples)
    def test_import_examples(example):
        with open(IMPORT_SCHEMA) as schema_data:
            schema = json.load(schema_data)
            resolver = jsonschema.RefResolver('file://' + IMPORT_SCHEMA, schema)
>           result = jsonschema.Draft4Validator(schema, resolver=resolver).validate(example)

tests\schemata\test_import_schema.py:94:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
env\lib\site-packages\jsonschema\validators.py:352: in validate
    for error in self.iter_errors(*args, **kwargs):
env\lib\site-packages\jsonschema\validators.py:328: in iter_errors
    for error in errors:
env\lib\site-packages\jsonschema\_validators.py:282: in properties
    for error in validator.descend(
env\lib\site-packages\jsonschema\validators.py:344: in descend
    for error in self.iter_errors(instance, schema):
env\lib\site-packages\jsonschema\validators.py:328: in iter_errors
    for error in errors:
env\lib\site-packages\jsonschema\_validators.py:259: in ref
    scope, resolved = validator.resolver.resolve(ref)
env\lib\site-packages\jsonschema\validators.py:766: in resolve
    return url, self._remote_cache(url)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <jsonschema.validators.RefResolver object at 0x00000249B3485670>
url = 'file://D:\\src\\ia\\openlibrary-client\\tests\\schemata\\../olclient/schemata/shared_definitions.json'

    def resolve_from_url(self, url):
        """
        Resolve the given remote URL.
        """
        url, fragment = urldefrag(url)
        try:
            document = self.store[url]
        except KeyError:
            try:
                document = self.resolve_remote(url)
            except Exception as exc:
>               raise exceptions.RefResolutionError(exc)
E               jsonschema.exceptions.RefResolutionError: <urlopen error [WinError 3] The system cannot find the path specified: '\\olclient\\schemata\\shared_definitions.json'>

env\lib\site-packages\jsonschema\validators.py:779: RefResolutionError
=========================== short test summary info ===========================
FAILED tests/test_openlibrary.py::TestOpenLibrary::test_edition_validation - ...
FAILED tests/test_openlibrary.py::TestOpenLibrary::test_work_validation - jso...
FAILED tests/test_openlibrary.py::TestAuthors::test_author_validation - jsons...
FAILED tests/test_openlibrary.py::TestTextType::test_edition_text_type - json...
FAILED tests/test_openlibrary.py::TestTextType::test_edition_text_type_from_string
FAILED tests/test_openlibrary.py::TestTextType::test_work_text_type - jsonsch...
FAILED tests/test_openlibrary.py::TestTextType::test_work_text_type_from_string
FAILED tests/schemata/test_import_schema.py::test_import_examples[example0]
FAILED tests/schemata/test_import_schema.py::test_import_examples[example1]
FAILED tests/schemata/test_import_schema.py::test_import_examples[example2]
======================== 10 failed, 36 passed in 2.54s ========================
(env)
/d/src/ia/openlibrary-client (master)$
```


Discussion / hints:

Fix patch:
diff --git a/olclient/openlibrary.py b/olclient/openlibrary.py
index a7fc6b08..8648d7f5 100644
--- a/olclient/openlibrary.py
+++ b/olclient/openlibrary.py
@@ -9,6 +9,7 @@
 import os
 import re
 from urllib.parse import urlencode
+from urllib.request import pathname2url
 
 import backoff
 import requests
@@ -101,10 +102,10 @@ def validate(self, doc, schema_name):
           jsonschema.exceptions.ValidationError if validation fails.
         """
         path = os.path.dirname(os.path.realpath(__file__))
-        schemata_path = f"{path}/schemata/{schema_name}"
+        schemata_path = os.path.join(path, 'schemata', schema_name)
         with open(schemata_path) as schema_data:
             schema = json.load(schema_data)
-            resolver = jsonschema.RefResolver('file://' + schemata_path, schema)
+            resolver = jsonschema.RefResolver('file:' + pathname2url(schemata_path), schema)
             return jsonschema.Draft4Validator(schema, resolver=resolver).validate(
                 doc.json()
             )


Test patch:
diff --git a/.github/workflows/test_python.yml b/.github/workflows/test_python.yml
index 53c38a21..592fd933 100644
--- a/.github/workflows/test_python.yml
+++ b/.github/workflows/test_python.yml
@@ -1,11 +1,23 @@
 name: tests
-on: [pull_request, push]
+on:
+  pull_request:
+    branches: [master]
+  push:
+    branches: [master]
+  workflow_dispatch:
 jobs:
   test_python:
-    runs-on: ubuntu-latest
+    strategy:
+      fail-fast: false
+      matrix:
+        os: [ubuntu-latest, windows-latest]  # , macos-latest]
+    runs-on: ${{ matrix.os }}
     steps:
       - name: Checkout code
         uses: actions/checkout@v3
+      - uses: actions/setup-python@v4
+        with:
+          python-version: 3.x
       - name: Install test dependencies
         run: pip install codespell -r requirements-dev.txt
       - run: codespell --ignore-words-list=ba,tha,wege
diff --git a/tests/schemata/test_import_schema.py b/tests/schemata/test_import_schema.py
index 7f6cc7f9..8402f7b8 100644
--- a/tests/schemata/test_import_schema.py
+++ b/tests/schemata/test_import_schema.py
@@ -1,10 +1,11 @@
 import json
+from nturl2path import pathname2url
 import jsonschema
 import os
 import pytest
 
 IMPORT_SCHEMA = os.path.join(
-    os.path.dirname(__file__), '../../olclient/schemata/import.schema.json'
+    os.path.dirname(__file__), '..', '..', 'olclient', 'schemata', 'import.schema.json'
 )
 
 # Examples taken from openlibrary/plugins/importapi/import_edition_builder.py
@@ -90,6 +91,6 @@
 def test_import_examples(example):
     with open(IMPORT_SCHEMA) as schema_data:
         schema = json.load(schema_data)
-        resolver = jsonschema.RefResolver('file://' + IMPORT_SCHEMA, schema)
+        resolver = jsonschema.RefResolver('file:' + pathname2url(IMPORT_SCHEMA), schema)
         result = jsonschema.Draft4Validator(schema, resolver=resolver).validate(example)
         assert result is None