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

Add temporary workaround for DM-7377 #86

Merged
merged 1 commit into from Aug 24, 2016
Merged

Add temporary workaround for DM-7377 #86

merged 1 commit into from Aug 24, 2016

Conversation

timj
Copy link
Member

@timj timj commented Aug 24, 2016

Introduce a workaround to prevent infinite recursion in the swig
catalog bindings

@@ -255,7 +255,8 @@ public:
# self._columns is created the when self.columns is accessed -
# looking for it in self.columns below would trigger infinite
# recursion.
if name == "_columns":
# Test for "this" as a temporary workaround for ticktet 7377
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Completely unimportant spelling mistake in this comment...

Copy link
Member Author

@timj timj Aug 24, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we know where "this" is coming from and why trapping it is a good idea? More as a means to help the comment on this line.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fairly certain it's coming from Swig: I think it must be trying to get it as an attribute before it exists, while wrapping that in a try/except block. But that only works if AttributeError is actually raised when it doesn't exist (as opposed to infinite recursion).

It might be a good idea to look at the Swig generated code (if we can get enough of a traceback to find it) to confirm that this is the case, but we could defer that to DM-7377.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Highly likely given this code in the .py file:

def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
    if (name == "thisown"):
        return self.this.own(value)
    if (name == "this"):
        if type(value).__name__ == 'SwigPyObject':
            self.__dict__[name] = value
            return

so SWIG is using a "this" attribute.

Introduce a workaround to prevent infinite recursion in the swig
catalog bindings
@natelust natelust merged commit a06936b into master Aug 24, 2016
@ktlim ktlim deleted the tickets/DM-7385 branch August 25, 2018 06:44
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

3 participants