From 7ee74438065567e2c6bc572bfd245eaa3a61f336 Mon Sep 17 00:00:00 2001 From: Aaron Steers Date: Mon, 21 Oct 2024 20:10:59 -0700 Subject: [PATCH] fix: don't fail on temp folder cleanup --- airbyte-cdk/python/airbyte_cdk/entrypoint.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/airbyte-cdk/python/airbyte_cdk/entrypoint.py b/airbyte-cdk/python/airbyte_cdk/entrypoint.py index 945d28405336..fdb00a1a366e 100644 --- a/airbyte-cdk/python/airbyte_cdk/entrypoint.py +++ b/airbyte-cdk/python/airbyte_cdk/entrypoint.py @@ -107,7 +107,11 @@ def run(self, parsed_args: argparse.Namespace) -> Iterable[str]: source_spec: ConnectorSpecification = self.source.spec(self.logger) try: - with tempfile.TemporaryDirectory() as temp_dir: + with tempfile.TemporaryDirectory( + # Cleanup can fail on Windows due to file locks. Ignore if so, + # rather than failing the whole process. + ignore_cleanup_errors=True, + ) as temp_dir: os.environ[ENV_REQUEST_CACHE_PATH] = temp_dir # set this as default directory for request_cache to store *.sqlite files if cmd == "spec": message = AirbyteMessage(type=Type.SPEC, spec=source_spec)