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

"ZPublisher.HTTPRequest.HTTPRequest.get": docstring not conform with the code #629

Closed
d-maurer opened this issue May 16, 2019 · 3 comments

Comments

@d-maurer
Copy link
Contributor

commented May 16, 2019

    def get(self, key, default=None, returnTaints=0, ...
            BASEmatch=re.compile('BASE(PATH)?([0-9]+)$').match,
            ):
        """Get a variable value

        Return a value for the required variable name.
        The value will be looked up from one of the request data
        categories. The search order is environment variables,
        other variables, form data, and then cookies.
        """
        other = self.other
        if key in other:
            if key == 'REQUEST':
                return self
            return other[key]
       ...

While the docstring says: "first environ then other", the code implements "first other".

@icemac

This comment has been minimized.

Copy link
Member

commented May 17, 2019

A PR to fix the docstring is welcome or do you think that the docstring should be the correct one and the implementation should be fixed?

@icemac icemac added this to the 4.0.1 milestone May 17, 2019

@icemac icemac added this to To do in Zope 4 bugfix via automation May 17, 2019

@d-maurer

This comment has been minimized.

Copy link
Contributor Author

commented May 17, 2019

d-maurer added a commit that referenced this issue May 18, 2019

bring request lookup order related documentation in line with the act…
…ual code (#629); minor refactorization/cleanup of `HTTPRequest.get`

dataflake added a commit that referenced this issue May 18, 2019

bring request lookup order related documentation in line with the act…
…ual code (#629); minor refactorization/cleanup of `HTTPRequest.get` (#632)
@dataflake

This comment has been minimized.

Copy link
Member

commented May 18, 2019

Fixed by #632

@dataflake dataflake closed this May 18, 2019

Zope 4 bugfix automation moved this from To do to Done May 18, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.