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

bpo-33911: Fixed deprecation warning in XML-RPC ServerHTMLDoc. #7847

Merged
merged 3 commits into from Jul 16, 2018
Merged

bpo-33911: Fixed deprecation warning in XML-RPC ServerHTMLDoc. #7847

merged 3 commits into from Jul 16, 2018

Conversation

niconoe
Copy link

@niconoe niconoe commented Jun 21, 2018

@the-knights-who-say-ni
Copy link

the-knights-who-say-ni commented Jun 21, 2018

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).

Unfortunately our records indicate you have not signed the CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

When your account is ready, please add a comment in this pull request
and a Python core developer will remove the CLA not signed label
to make the bot check again.

Thanks again for your contribution, we look forward to reviewing it!

@vstinner
Copy link
Member

vstinner commented Jun 21, 2018

Does your PR change the output? If yes, it should be documented with a new NEWS entry (use the "blurb" tool to add it: https://devguide.python.org/committing/#what-s-new-and-news-entries ).

@vstinner
Copy link
Member

vstinner commented Jun 21, 2018

@1st1: Would you mind to have a look?

1st1
1st1 previously requested changes Jun 21, 2018
annotations=args.annotations,
formatvalue=self.formatvalue
)
sig.replace(parameters=tuple(sig.parameters.values())[1:])
Copy link
Member

@1st1 1st1 Jun 21, 2018

Choose a reason for hiding this comment

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

sig.replace() returns a new Signature object, so you should have written sig = sig.replace(...). But inspect.signature should take care of the bound argument automatically, so you don't need this dance. if and elif clauses should be replaced with

if callable(object):
    argspec = str(signature(object))
else:
    argspec = '(...)'

Copy link
Member

@serhiy-storchaka serhiy-storchaka Jun 21, 2018

Choose a reason for hiding this comment

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

How common a failure of signature()? Shouldn't we catch some common exceptions?

Copy link
Member

@1st1 1st1 Jun 21, 2018

Choose a reason for hiding this comment

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

inspect.getfullargspec uses inspect.signature behind the scenes. So if you want to add some error handling, it should be in a separate PR.

@bedevere-bot
Copy link

bedevere-bot commented Jun 21, 2018

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@niconoe
Copy link
Author

niconoe commented Jun 22, 2018

I have made the requested changes; please review again.

@vstinner: AFAIK, the output doesn't change (HTML output is compared in various test methods in test_docxmlrpc.py). What I didn't do is to ensure that this existing test coverage is extensive. Should I?

@bedevere-bot
Copy link

bedevere-bot commented Jun 22, 2018

Thanks for making the requested changes!

@1st1: please review the changes made to this pull request.

@vstinner vstinner dismissed 1st1’s stale review Jul 12, 2018

The PR no longer uses sig.replace() but just: argspec = str(signature(object))

Copy link
Member

@vstinner vstinner left a comment

LGTM.

"./python -W error -m test test_docxmlrpc" now pass, so the PR fixed the issue that I reported.

test_docxmlrpc still pass which means that the HTML is not modified by this change.

@vstinner
Copy link
Member

vstinner commented Jul 12, 2018

@1st1: Would you mind to review again the change?

@miss-islington
Copy link
Contributor

miss-islington commented Jul 16, 2018

Thanks @niconoe for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒🤖

@bedevere-bot
Copy link

bedevere-bot commented Jul 16, 2018

GH-8294 is a backport of this pull request to the 3.7 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 16, 2018
Replace deprecated inspect.getfullargspec() with inspect.signature().
(cherry picked from commit 35c0809)

Co-authored-by: Nicolas Noé <nicolas@niconoe.org>
vstinner pushed a commit that referenced this pull request Jul 16, 2018
)

Replace deprecated inspect.getfullargspec() with inspect.signature().
(cherry picked from commit 35c0809)

Co-authored-by: Nicolas Noé <nicolas@niconoe.org>
yahya-abou-imran pushed a commit to yahya-abou-imran/cpython that referenced this pull request Nov 2, 2018
Replace deprecated inspect.getfullargspec() with inspect.signature().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants