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

Raise a Py3K warning for __getitem__ or __getslice__ on exception instances #46632

Closed
abalkin opened this issue Mar 18, 2008 · 4 comments
Closed
Assignees
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) release-blocker type-bug An unexpected behavior, bug, or error

Comments

@abalkin
Copy link
Member

abalkin commented Mar 18, 2008

BPO 2379
Nosy @gvanrossum, @abalkin
Files
  • issue2379.diff
  • 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/gvanrossum'
    closed_at = <Date 2008-03-18.04:43:06.204>
    created_at = <Date 2008-03-18.03:15:37.887>
    labels = ['interpreter-core', 'type-bug', 'release-blocker']
    title = 'Raise a Py3K warning for __getitem__ or __getslice__ on exception instances'
    updated_at = <Date 2008-03-18.04:43:06.203>
    user = 'https://github.com/abalkin'

    bugs.python.org fields:

    activity = <Date 2008-03-18.04:43:06.203>
    actor = 'gvanrossum'
    assignee = 'gvanrossum'
    closed = True
    closed_date = <Date 2008-03-18.04:43:06.204>
    closer = 'gvanrossum'
    components = ['Interpreter Core']
    creation = <Date 2008-03-18.03:15:37.887>
    creator = 'belopolsky'
    dependencies = []
    files = ['9718']
    hgrepos = []
    issue_num = 2379
    keywords = ['patch']
    message_count = 4.0
    messages = ['63864', '63877', '63880', '63885']
    nosy_count = 2.0
    nosy_names = ['gvanrossum', 'belopolsky']
    pr_nums = []
    priority = 'release blocker'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue2379'
    versions = ['Python 2.6']

    @abalkin
    Copy link
    Member Author

    abalkin commented Mar 18, 2008

    As requested by Guido at msg63858. Will create a patch.

    @abalkin abalkin added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error labels Mar 18, 2008
    @abalkin
    Copy link
    Member Author

    abalkin commented Mar 18, 2008

    With the attached patch and -3 option:

    >>> Exception(1,2,3)[0]
    __main__:1: DeprecationWarning: In 3.x, __getitem__ is not supported for 
    exception classes, use args attribute
    1
    >>> Exception(1,2,3)[:]
    __main__:1: DeprecationWarning: In 3.x, __getslice__ is not supported 
    for exception classes, use args attribute
    (1, 2, 3)

    @gvanrossum
    Copy link
    Member

    I'll review this soon.

    @gvanrossum
    Copy link
    Member

    Cleaned up and committed as r61489.

    Thanks!!

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 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) release-blocker type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants