FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-146615: Fix error message in method_get for invalid type argument by sunmy2019 · Pull Request #146634 · python/cpython · GitHub

/ cpython Public

gh-146615: Fix error message in method_get for invalid type argument - #146634

Merged
serhiy-storchaka merged 5 commits into
python:mainfrom
sunmy2019:gh-146615-5
Mar 31, 2026
Merged

gh-146615: Fix error message in method_get for invalid type argument#146634
serhiy-storchaka merged 5 commits into
python:mainfrom
sunmy2019:gh-146615-5

Conversation

sunmy2019 commented Mar 30, 2026
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Please add a test and a NEWS entry.

serhiy-storchaka added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Mar 30, 2026
sunmy2019 marked this pull request as ready for review March 30, 2026 18:01
Comment thread Lib/test/test_descr.py Outdated
# METH_METHOD|METH_FASTCALL|METH_KEYWORDS is the only flag combination
# that enters the affected branch in method_get().

import xxlimited

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

It could be tested without the use of the optional xxlimited module. For example:

array.array.extend.__get__(array.array('I'), 'not_a_type')

Of course, using METH_METHOD|METH_FASTCALL|METH_KEYWORDS in the implementation of array.array.extend is CPython specific, so you can try several other classes and methods in hope that they are implemented in such way. If none of them raises a TypeError, then skip the test (skipTest()). Or maybe mark the test CPython-only?

sunmy2019 Mar 30, 2026
edited
Loading

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

mark the test CPython-only?

I think this is reasonable. This problem only occurs in C modules. It cannot trigger in pure Python code.

I checked

array.array.extend.__get__(array.array('I'), 'not_a_type')

will not raise error in Pypy.

Copy link
Copy Markdown
Member

LGTM. 👍

serhiy-storchaka merged commit 72d29ea into python:main Mar 31, 2026
57 checks passed

Copy link
Copy Markdown

Thanks @sunmy2019 for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

bedevere-app Bot commented Mar 31, 2026

Copy link
Copy Markdown

GH-146647 is a backport of this pull request to the 3.14 branch.

bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Mar 31, 2026
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 31, 2026
…ith invalid type argument (pythonGH-146634)

(cherry picked from commit 72d29ea)

Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 31, 2026
…ith invalid type argument (pythonGH-146634)

(cherry picked from commit 72d29ea)

Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>

bedevere-app Bot commented Mar 31, 2026

Copy link
Copy Markdown

GH-146648 is a backport of this pull request to the 3.13 branch.

bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Mar 31, 2026
serhiy-storchaka pushed a commit that referenced this pull request Mar 31, 2026
…with invalid type argument (GH-146634) (GH-146647)

(cherry picked from commit 72d29ea)

Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
serhiy-storchaka pushed a commit that referenced this pull request Mar 31, 2026
…with invalid type argument (GH-146634) (GH-146648)

(cherry picked from commit 72d29ea)

Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
maurycy added a commit to maurycy/cpython that referenced this pull request Mar 31, 2026
* main:
  pythongh-145458: use `self.skip_idle` consistently in the tachyon profiler (python#145459)
  pythongh-146615: Fix format specifiers in Objects/ directory (pythonGH-146620)
  pythongh-146615: Fix format specifiers in Python/ directory (pythonGH-146619)
  pythongh-146615: Fix format specifiers in test cextensions (pythonGH-146618)
  pythongh-146615: Fix format specifiers in extension modules (pythonGH-146617)
  pythongh-146615: Fix crash in __get__() for METH_METHOD descriptors with invalid type argument (pythonGH-146634)
  pythongh-146376: Reduce timeout in Emscripten GHA workflow (python#146378)
  pythongh-146442: Fix various bugs in compiler pipeline (python#146443)
  pythongh-146238: Support half-floats in the array module (python#146242)
  pythongh-145056: Add support for merging collections.UserDict and frozendict (pythonGH-146465)
  pythongh-145056: Fix merging of collections.OrderedDict and frozendict (pythonGH-146466)
  pythongh-139633: Run netrc file permission check only once per parse (pythonGH-139634)
clin1234 pushed a commit to clin1234/cpython that referenced this pull request Apr 16, 2026
ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL