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

interface cache can be simplified since we depend on zope.interface 5.0 #104

Closed
jamadden opened this issue Apr 6, 2020 · 1 comment · Fixed by #106
Closed

interface cache can be simplified since we depend on zope.interface 5.0 #104

jamadden opened this issue Apr 6, 2020 · 1 comment · Fixed by #106

Comments

@jamadden
Copy link
Member

jamadden commented Apr 6, 2020

The try/except is not needed.

https://github.com/NextThought/nti.externalization/blob/907b3cda5b0121d42e2463503c57fe9a262f1ba9/src/nti/externalization/_interface_cache.py#L50-L57

Also, there's a subtle race-condition here if anyone tries to use _v_attrs later, as _make_modified_attributes does.

https://github.com/NextThought/nti.externalization/blob/907b3cda5b0121d42e2463503c57fe9a262f1ba9/src/nti/externalization/internalization/events.py#L55-L60

This low-level method should also return the _v_attrs dict (and maybe the providedBy object) it's using to avoid this.

@jamadden
Copy link
Member Author

jamadden commented Apr 6, 2020

That race condition bites us because of zopefoundation/zope.container#38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant