diff --git a/src/inspect_ai/util/_context/resource.py b/src/inspect_ai/util/_context/resource.py index 4be6f4c0..8b03dac9 100644 --- a/src/inspect_ai/util/_context/resource.py +++ b/src/inspect_ai/util/_context/resource.py @@ -79,7 +79,10 @@ def read_resource() -> str: # no scheme means either a local file or a string else: # extract the path - path = url2pathname(parsed.path) + try: + path = url2pathname(parsed.path) + except OSError: + return resource # return it if it exists (otherwise return the str) fs = filesystem(path)