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

classmethod abuse --> SystemError #38631

Closed
mwhudson opened this issue Jun 12, 2003 · 3 comments
Closed

classmethod abuse --> SystemError #38631

mwhudson opened this issue Jun 12, 2003 · 3 comments
Assignees
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@mwhudson
Copy link

BPO 753451
Nosy @mwhudson, @brettcannon, @rhettinger

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/rhettinger'
closed_at = <Date 2003-06-18.01:13:56.000>
created_at = <Date 2003-06-12.18:09:50.000>
labels = ['interpreter-core']
title = 'classmethod abuse --> SystemError'
updated_at = <Date 2003-06-18.01:13:56.000>
user = 'https://github.com/mwhudson'

bugs.python.org fields:

activity = <Date 2003-06-18.01:13:56.000>
actor = 'rhettinger'
assignee = 'rhettinger'
closed = True
closed_date = None
closer = None
components = ['Interpreter Core']
creation = <Date 2003-06-12.18:09:50.000>
creator = 'mwh'
dependencies = []
files = []
hgrepos = []
issue_num = 753451
keywords = []
message_count = 3.0
messages = ['16347', '16348', '16349']
nosy_count = 3.0
nosy_names = ['mwh', 'brett.cannon', 'rhettinger']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue753451'
versions = []

@mwhudson
Copy link
Author

This is obviously a silly thing to do:

>>> classmethod(1).__get__(1)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
SystemError: ../Objects/classobject.c:2102: bad
argument to internal function

but I think that's still a bug.

@mwhudson mwhudson added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Jun 12, 2003
@brettcannon
Copy link
Member

Logged In: YES
user_id=357491

Well, couldn't we check if the argument is a non-data descriptor
at least? Since classmethod only works with new-style we know
the method will be a non-data descriptor. That should prevent
allowing arguments like 1 being allowed through.

@rhettinger
Copy link
Contributor

Logged In: YES
user_id=80475

Added a callability check.
See Objects/funcobject.c 1.195

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)
Projects
None yet
Development

No branches or pull requests

3 participants