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-106359: Fix corner case bugs in Argument Clinic converter parser by erlend-aasland · Pull Request #106361 · python/cpython

Conversation

@erlend-aasland

@erlend-aasland erlend-aasland commented Jul 3, 2023 •
edited by bedevere-bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

DSLParser.parse_converter() could return unusable kwdicts in some rare cases

  • Issue: Argument Clinic: DSLParser.parse_converter() can return an incorrect kwargs dict #106359

Sorry, something went wrong.

Uh oh!

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

All reactions
@erlend-aasland
pythongh-106359: Fix corner case bugs in Argument Clinic converter pa…
851f63c
…rser

DSLParser.parse_converter() could return unusable kwdicts in some rare cases
@erlend-aasland
erlend-aasland requested a review from AlexWaygood July 3, 2023 11:50
@bedevere-bot bedevere-bot added the awaiting core review label Jul 3, 2023
@bedevere-bot bedevere-bot mentioned this pull request Jul 3, 2023
Argument Clinic: DSLParser.parse_converter() can return an incorrect kwargs dict #106359
Closed
@erlend-aasland

erlend-aasland commented Jul 3, 2023

Copy link
Copy Markdown
Contributor Author

I took the liberty of cleaning up the test case a little bit.

All reactions

Sorry, something went wrong.

Uh oh!

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

erlend-aasland
erlend-aasland commented Jul 3, 2023
View reviewed changes
Comment thread Tools/clinic/clinic.py Resolved

Uh oh!

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

AlexWaygood
AlexWaygood reviewed Jul 3, 2023
View reviewed changes
Comment thread Tools/clinic/clinic.py Resolved

Uh oh!

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

erlend-aasland added 5 commits July 3, 2023 13:57
@erlend-aasland
Move KwargDict up and name it slightly better
bb879cc
@erlend-aasland
Remove debug print
07abdd5
@erlend-aasland
Add NEWS
5009748
@erlend-aasland
Address review: try with a slightly more accurate error message
288d8ca
@erlend-aasland
kwarg splat
7efc3b4
@erlend-aasland

erlend-aasland commented Jul 3, 2023

Copy link
Copy Markdown
Contributor Author

Backport to 3.12 and possibly 3.11?

All reactions

Sorry, something went wrong.

Uh oh!

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

AlexWaygood
AlexWaygood approved these changes Jul 3, 2023
View reviewed changes

@AlexWaygood AlexWaygood 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.

Looks great! One small suggestion to make the test slightly more exacting:

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Lib/test/test_clinic.py Resolved

Uh oh!

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

@bedevere-bot bedevere-bot removed the awaiting core review label Jul 3, 2023
@AlexWaygood

AlexWaygood commented Jul 3, 2023

Copy link
Copy Markdown
Member

Backport to 3.12 and possibly 3.11?

I was wondering about that. I doubt it'll backport cleanly, though, and this seems like very much a corner-case bug that people are unlikely to hit in practice. So maybe not worth it?

All reactions

Sorry, something went wrong.

Uh oh!

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

@erlend-aasland @AlexWaygood
Address review: make the test slightly more accurate
5ac8553
Co-authored-by: Alex Waygood <[email protected]>
@erlend-aasland

erlend-aasland commented Jul 3, 2023 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor Author

Backport to 3.12 and possibly 3.11?

I was wondering about that. I doubt it'll backport cleanly, though, and this seems like very much a corner-case bug that people are unlikely to hit in practice. So maybe not worth it?

Yeah, I was thinking the same. Let's try 3.12; if the witch can backport it, it's ok; if she fails, let's not bother.

AlexWaygood reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

@erlend-aasland erlend-aasland added the needs backport to 3.12 only security fixes label Jul 3, 2023
@erlend-aasland
erlend-aasland enabled auto-merge (squash) July 3, 2023 12:26
@erlend-aasland erlend-aasland linked an issue Jul 3, 2023 that may be closed by this pull request
Argument Clinic: DSLParser.parse_converter() can return an incorrect kwargs dict #106359
Closed
AlexWaygood
AlexWaygood reviewed Jul 3, 2023
View reviewed changes

@AlexWaygood AlexWaygood 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.

...Two more small nits, sorry!

Sorry, something went wrong.

Uh oh!

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

erlend-aasland reacted with heart emoji
All reactions
  • ❤️ 1 reaction
Comment thread Misc/NEWS.d/next/Tools-Demos/2023-07-03-14-06-19.gh-issue-106359.RfJuR0.rst Resolved

Uh oh!

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

Comment thread Lib/test/test_clinic.py Resolved

Uh oh!

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

@erlend-aasland @AlexWaygood
Apply suggestions from code review
5d88ab6
Co-authored-by: Alex Waygood <[email protected]>
erlend-aasland
erlend-aasland commented Jul 3, 2023
View reviewed changes
Comment thread Misc/NEWS.d/next/Tools-Demos/2023-07-03-14-06-19.gh-issue-106359.RfJuR0.rst Resolved

Uh oh!

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

@erlend-aasland
Update Misc/NEWS.d/next/Tools-Demos/2023-07-03-14-06-19.gh-issue-1063…
2a3e35f
…59.RfJuR0.rst
AlexWaygood
AlexWaygood approved these changes Jul 3, 2023
View reviewed changes

@AlexWaygood AlexWaygood 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.

🚀

Sorry, something went wrong.

Uh oh!

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

All reactions
@bedevere-bot bedevere-bot added the awaiting merge label Jul 3, 2023
@AlexWaygood
fix lint
ec602b5
AlexWaygood
AlexWaygood reviewed Jul 3, 2023
View reviewed changes
Comment thread Lib/test/test_clinic.py Resolved

Uh oh!

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

@erlend-aasland
Fix test
8fcb618
@erlend-aasland
Add a few more tests
67425eb
AlexWaygood
AlexWaygood reviewed Jul 3, 2023
View reviewed changes
Comment thread Lib/test/test_clinic.py Resolved

Uh oh!

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

erlend-aasland added 2 commits July 3, 2023 14:48
@erlend-aasland
Don't just use None
277c01b
@erlend-aasland
quotes
99ad510
AlexWaygood
AlexWaygood approved these changes Jul 3, 2023
View reviewed changes

@AlexWaygood AlexWaygood 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.

Thanks! The new test cases make it clearer what we're testing here. (I'm losing count of the number of times I'm approving this PR 😄)

Sorry, something went wrong.

Uh oh!

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

erlend-aasland reacted with laugh emoji
All reactions
  • 😄 1 reaction
@erlend-aasland

erlend-aasland commented Jul 3, 2023

Copy link
Copy Markdown
Contributor Author

Thanks! The new test cases make it clearer what we're testing here. (I'm losing count of the number of times I'm approving this PR 😄)

THIS IS THE FINAL VERSION! 🤞

AlexWaygood reacted with laugh emoji AlexWaygood reacted with eyes emoji
All reactions
  • 😄 1 reaction
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

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

@erlend-aasland
erlend-aasland merged commit 0da4c88 into python:main Jul 3, 2023
@miss-islington

miss-islington commented Jul 3, 2023

Copy link
Copy Markdown
Contributor

Thanks @erlend-aasland for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot bedevere-bot removed the awaiting merge label Jul 3, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 3, 2023
@erlend-aasland @AlexWaygood @miss-islington
pythongh-106359: Fix corner case bugs in Argument Clinic converter pa…
877ebdd
…rser (pythonGH-106361)

DSLParser.parse_converter() could return unusable kwdicts in some rare cases

(cherry picked from commit 0da4c88)

Co-authored-by: Erlend E. Aasland <[email protected]>
Co-authored-by: Alex Waygood <[email protected]>
@bedevere-bot

bedevere-bot commented Jul 3, 2023

Copy link
Copy Markdown

GH-106364 is a backport of this pull request to the 3.12 branch.

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot bedevere-bot removed the needs backport to 3.12 only security fixes label Jul 3, 2023
@erlend-aasland
erlend-aasland deleted the clinic/fix-parse-converter branch July 3, 2023 13:16
AlexWaygood added a commit that referenced this pull request Jul 3, 2023
@miss-islington @erlend-aasland @AlexWaygood
[3.12] gh-106359: Fix corner case bugs in Argument Clinic converter p…
5f20152
…arser (GH-106361) (#106364)

gh-106359: Fix corner case bugs in Argument Clinic converter parser (GH-106361)

DSLParser.parse_converter() could return unusable kwdicts in some rare cases

(cherry picked from commit 0da4c88)

Co-authored-by: Erlend E. Aasland <[email protected]>
Co-authored-by: Alex Waygood <[email protected]>
carljm added a commit to carljm/cpython that referenced this pull request Jul 3, 2023
@carljm
Merge branch 'main' into modulelocals
ac11740
* main: (167 commits)
  pythongh-91053: make func watcher tests resilient to other func watchers (python#106286)
  pythongh-104050: Add more type hints to Argument Clinic DSLParser() (python#106354)
  pythongh-106359: Fix corner case bugs in Argument Clinic converter parser (python#106361)
  pythongh-104146: Remove unused attr 'parameter_indent' from clinic.DLParser (python#106358)
  pythongh-106320: Remove private _PyErr C API functions (python#106356)
  pythongh-104050: Annotate Argument Clinic DSLParser attributes (python#106357)
  pythongh-106320: Create pycore_modsupport.h header file (python#106355)
  pythongh-106320: Move _PyUnicodeWriter to the internal C API (python#106342)
  pythongh-61215: New mock to wait for multi-threaded events to happen (python#16094)
  Document PYTHONSAFEPATH along side -P (python#106122)
  Replace the esoteric term 'datum' when describing dict comprehensions (python#106119)
  pythongh-104050: Add more type hints to Argument Clinic DSLParser() (python#106343)
  pythongh-106320: _testcapi avoids private _PyUnicode_EqualToASCIIString() (python#106341)
  pythongh-106320: Add pycore_complexobject.h header file (python#106339)
  pythongh-106078: Move DecimalException to _decimal state (python#106301)
  pythongh-106320: Use _PyInterpreterState_GET() (python#106336)
  pythongh-106320: Remove private _PyInterpreterState functions (python#106335)
  pythongh-104922: Doc: add note about PY_SSIZE_T_CLEAN (python#106314)
  pythongh-106217: Truncate the issue body size of `new-bugs-announce-notifier` (python#106329)
  pythongh-104922: remove PY_SSIZE_T_CLEAN (python#106315)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@AlexWaygood AlexWaygood AlexWaygood approved these changes

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.

Argument Clinic: DSLParser.parse_converter() can return an incorrect kwargs dict

Uh oh!

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

4 participants

@erlend-aasland @AlexWaygood @miss-islington @bedevere-bot
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.