Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix(python-cdk): Don't fail on temp folder cleanup #47220

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion airbyte-cdk/python/airbyte_cdk/entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading