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

'hasattr' fix to suppress only AttributeError #53875

Closed
YurySelivanov mannequin opened this issue Aug 24, 2010 · 2 comments
Closed

'hasattr' fix to suppress only AttributeError #53875

YurySelivanov mannequin opened this issue Aug 24, 2010 · 2 comments
Assignees
Labels
docs Documentation in the Doc dir stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@YurySelivanov
Copy link
Mannequin

YurySelivanov mannequin commented Aug 24, 2010

BPO 9666
Nosy @jcea, @benjaminp
Files
  • hasattr.patch
  • 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/benjaminp'
    closed_at = <Date 2010-08-24.03:27:52.630>
    created_at = <Date 2010-08-24.02:56:06.335>
    labels = ['type-bug', 'library', 'docs']
    title = "'hasattr' fix to suppress only AttributeError"
    updated_at = <Date 2010-09-28.17:15:20.674>
    user = 'https://bugs.python.org/YurySelivanov'

    bugs.python.org fields:

    activity = <Date 2010-09-28.17:15:20.674>
    actor = 'jcea'
    assignee = 'benjamin.peterson'
    closed = True
    closed_date = <Date 2010-08-24.03:27:52.630>
    closer = 'benjamin.peterson'
    components = ['Documentation', 'Library (Lib)']
    creation = <Date 2010-08-24.02:56:06.335>
    creator = 'Yury.Selivanov'
    dependencies = []
    files = ['18622']
    hgrepos = []
    issue_num = 9666
    keywords = ['gsoc']
    message_count = 2.0
    messages = ['114767', '114768']
    nosy_count = 4.0
    nosy_names = ['jcea', 'benjamin.peterson', 'docs@python', 'Yury.Selivanov']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue9666'
    versions = ['Python 3.2']

    @YurySelivanov
    Copy link
    Mannequin Author

    YurySelivanov mannequin commented Aug 24, 2010

    As discussed on python-dev mailing list (http://mail.python.org/pipermail/python-dev/2010-August/103178.html), 'hasattr' default behaviour should be changed to suppress only AttributeError exceptions. Other should pass through.

    The fix, however, shouldn't change behaviour of existing C API, functions PyObject_HasAttr and PyObject_HasAttrString in particular.

    I'm targeting this issue on Python 3.2 version, but probably it may be introduced in the next Python 3.1 maintenance release.

    @YurySelivanov YurySelivanov mannequin added docs Documentation in the Doc dir stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Aug 24, 2010
    @benjaminp benjaminp assigned benjaminp and unassigned docspython Aug 24, 2010
    @benjaminp
    Copy link
    Contributor

    Fixed in r84294. I will not backport to 3.1. Thanks for the contribution!

    @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
    docs Documentation in the Doc dir stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant