Skip to content

Retry lazy attribute lookups after a transient factory error - #1451

Closed
shrohan2003 wants to merge 1 commit into
python-babel:masterfrom
shrohan2003:fix/lazy-proxy-retry
Closed

shrohan2003 wants to merge 1 commit into
python-babel:masterfrom
shrohan2003:fix/lazy-proxy-retry

Conversation

@shrohan2003

Copy link
Copy Markdown

If a LazyProxy factory raises AttributeError once, calling a method on the proxy again re-raises the saved exception without retrying the factory. This can leave a proxy unusable even after its backing value becomes available.

Limit replay of the property's exception to lookup of the value property itself, and clear it after successful evaluation. The regression test exercises a fail-once factory through a forwarded method with caching enabled and disabled.

@akx

akx commented Nov 9, 2026

Copy link
Copy Markdown
Member

I don't think this is necessary.

@akx akx closed this Nov 9, 2026
@shrohan2003

Copy link
Copy Markdown
Author

Thanks for taking a look, @akx. Understood.

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.

2 participants