GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-107944: Improve error message for getargs with bad keyword arguments by hauntsaninja · Pull Request #114792 · python/cpython

Conversation

@hauntsaninja

@hauntsaninja hauntsaninja commented Jan 31, 2024 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor
  • Issue: Improve error message for function calls with bad keyword arguments #107944

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@hauntsaninja
pythongh-107944: Improve error message for getargs with bad keyword a…
f78eaeb
…rguments
@bedevere-app bedevere-app Bot mentioned this pull request Jan 31, 2024
Improve error message for function calls with bad keyword arguments #107944
Closed
@bedevere-app bedevere-app Bot added the awaiting core review label Jan 31, 2024
blurb-it Bot and others added 2 commits January 31, 2024 09:10
@blurb-it
📜🤖 Added by blurb_it.
713f85a
@hauntsaninja
add a what's new
a303953
@hauntsaninja
hauntsaninja requested a review from pablogsal January 31, 2024 09:14
hauntsaninja
hauntsaninja commented Jan 31, 2024
View reviewed changes
Comment thread Python/getargs.c
}
else {
PyErr_Format(PyExc_TypeError,
"%.200s%s got an unexpected keyword argument '%S'",

@hauntsaninja hauntsaninja Jan 31, 2024

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I made this error message match the one in ceval.c

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@hauntsaninja
add another test case
7a3804d
@hauntsaninja

hauntsaninja commented Jan 31, 2024

Copy link
Copy Markdown
Contributor Author

I still need to do the vgetargskeywords path...

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

pablogsal
pablogsal reviewed Jan 31, 2024
View reviewed changes
Comment thread Lib/test/test_call.py
with self.check_suggestion_includes(suggestion):
func(bluch=None)

def test_unexpected_keyword_suggestion_via_getargs(self):

@pablogsal pablogsal Jan 31, 2024

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Do you mind adding a explicit test for when the suggestion fails (the 'else' case in the conditional here

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@hauntsaninja hauntsaninja Jan 31, 2024

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Thanks for the review! I added this test.

I also made a similar edit in the vgetargskeywords code path and added tests.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
pablogsal
pablogsal approved these changes Jan 31, 2024
View reviewed changes

@pablogsal pablogsal left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Very good work @hauntsaninja! Thanks for working on this

This looks great, I left some nit but please feel free to ignore

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Jan 31, 2024
@hauntsaninja
Fix vgetargskeywords path, explicit error test
d178541
@hauntsaninja
hauntsaninja requested a review from iritkatriel as a code owner January 31, 2024 09:55
@hauntsaninja
nit: change test order
ec06393
@hauntsaninja
hauntsaninja merged commit 17689e3 into python:main Feb 8, 2024
@bedevere-app bedevere-app Bot removed the awaiting merge label Feb 8, 2024
@hauntsaninja
hauntsaninja deleted the gh107944 branch February 8, 2024 09:04
fsc-eriker pushed a commit to fsc-eriker/cpython that referenced this pull request Feb 14, 2024
@hauntsaninja @fsc-eriker
pythongh-107944: Improve error message for getargs with bad keyword a…
005c3f6
…rguments (python#114792)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@pablogsal pablogsal pablogsal approved these changes
@iritkatriel iritkatriel Awaiting requested review from iritkatriel iritkatriel is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@hauntsaninja @pablogsal
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.