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

Destructor of LocalTarget sometimes fails with AttributeError: 'LocalTarget' object has no attribute 'is_tmp' #3085

Merged
merged 4 commits into from Jan 11, 2022

Conversation

umartin
Copy link
Contributor

@umartin umartin commented Jun 14, 2021

Description

This PR makes the destructor of LocalTarget more robust in case of partially initialised objects.

Motivation and Context

LocalTarget might not be fully initialised if an exception is thrown in the constructor of LocalTarget or a subclass.
Python will call the destructor anyway which will fail since is_tmp is not initialized.
Initialising is_tmp earlier in the constructor solves the problem in case of exceptions in LocalTarget but not for subclasses.
Possibly related to #3020

Have you tested this? If so, how?

Unit test added.

@umartin umartin requested review from dlstadther, Tarrasch and a team as code owners June 14, 2021 09:54
@stale
Copy link

stale bot commented Jan 9, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If closed, you may revisit when your time allows and reopen! Thank you for your contributions.

@stale stale bot added the wontfix label Jan 9, 2022
@stale stale bot removed the wontfix label Jan 11, 2022
@dlstadther
Copy link
Collaborator

Apologies for massive delay. Stalebot comments on a bunch of Luigi PRs and that reminded me that I approved some PRs and never merged them. Going back through them now, updating them with master, and confirming that all their checks pass.

@dlstadther dlstadther merged commit fa40e2c into spotify:master Jan 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants