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 incorrect use of self.__class__ in super #578

Merged
merged 1 commit into from
Feb 12, 2021

Conversation

fmigneault
Copy link
Collaborator

Overview

Fix incorrect use of self.__class__ in super call.

Additional Information

In the actual context, it just so happens that self.__class__ is equal to ExecuteResponse and produces the same result.
When that class is derived though, to add additional functionalities, the value changes and causes endless recursion.

class DerivedExecuteResponse(ExecuteResponse): 
    def __init__(self, wps_request, uuid):
        super(ExecuteResponse, self).__init__(wps_request, uuid)
        # other setup... 

class ExecuteResponse(WPSResponse):
    def __init__(self, wps_request, uuid, **kwargs):
        # here 'self.__class__'  == 'DerivedExecuteResponse'
        # 'super(self.__class__, self)' resolves to 'ExecuteResponse', so it calls itself !
        super(self.__class__, self).__init__(wps_request, uuid)

Contribution Agreement

(as per https://github.com/geopython/pywps/blob/master/CONTRIBUTING.rst#contributions-and-licensing)

  • I'd like to contribute [feature X|bugfix Y|docs|something else] to PyWPS. I confirm that my contributions to PyWPS will be compatible with the PyWPS license guidelines at the time of contribution.
  • I have already previously agreed to the PyWPS Contributions and Licensing Guidelines

@coveralls
Copy link

Coverage Status

Coverage remained the same at 0.0% when pulling 4270724 on fmigneault:super-class into e10c99c on geopython:pywps-4.4.

@fmigneault
Copy link
Collaborator Author

@cehbrecht
Would be great if that can be integrated in #577
So far only found this problem while using 4.4, the rest seems to work correctly.

@cehbrecht cehbrecht added the bug label Feb 12, 2021
@cehbrecht
Copy link
Collaborator

@fmigneault Thanks for the fix 👍 I will update the release notes.

@cehbrecht cehbrecht merged commit b3d6ce6 into geopython:pywps-4.4 Feb 12, 2021
@fmigneault fmigneault deleted the super-class branch October 29, 2021 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants