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

Exception AttributeError: "'NoneType' object has no attribute #59398

Closed
prime mannequin opened this issue Jun 26, 2012 · 3 comments
Closed

Exception AttributeError: "'NoneType' object has no attribute #59398

prime mannequin opened this issue Jun 26, 2012 · 3 comments
Labels
type-bug An unexpected behavior, bug, or error

Comments

@prime
Copy link
Mannequin

prime mannequin commented Jun 26, 2012

BPO 15193
Nosy @amauryfa, @mdickinson
Files
  • objectvar.py
  • 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 = None
    closed_at = <Date 2012-06-26.13:19:10.185>
    created_at = <Date 2012-06-26.13:05:20.417>
    labels = ['type-bug', 'invalid']
    title = 'Exception AttributeError: "\'NoneType\' object has no attribute'
    updated_at = <Date 2012-06-26.13:31:58.169>
    user = 'https://bugs.python.org/prime'

    bugs.python.org fields:

    activity = <Date 2012-06-26.13:31:58.169>
    actor = 'amaury.forgeotdarc'
    assignee = 'none'
    closed = True
    closed_date = <Date 2012-06-26.13:19:10.185>
    closer = 'mark.dickinson'
    components = []
    creation = <Date 2012-06-26.13:05:20.417>
    creator = 'prime'
    dependencies = []
    files = ['26168']
    hgrepos = []
    issue_num = 15193
    keywords = []
    message_count = 3.0
    messages = ['164073', '164074', '164075']
    nosy_count = 3.0
    nosy_names = ['amaury.forgeotdarc', 'mark.dickinson', 'prime']
    pr_nums = []
    priority = 'normal'
    resolution = 'not a bug'
    stage = None
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue15193'
    versions = ['Python 2.7']

    @prime
    Copy link
    Mannequin Author

    prime mannequin commented Jun 26, 2012

    Behavior of the program changes with number of charaters used in variable name. Attached file shows a simple example.

    @prime prime mannequin added the type-bug An unexpected behavior, bug, or error label Jun 26, 2012
    @mdickinson
    Copy link
    Member

    The exception you report looks incomplete: there should be something after the 'no attribute' saying which attribute lookup failed.

    In any case, I don't thing this is a bug. It sounds like a result of the unpredictability of cleanup order at interpreter shutdown: you're encountering a situation where the 'Person' reference has already been deleted from the module namespace before the __del__ method for one of the Person instances gets called; so the 'Person' name lookup in the __del__ method fails. You could get around this by replacing 'Person' with 'type(self)' in __del__.

    @amauryfa
    Copy link
    Member

    See also this warning message: http://docs.python.org/reference/datamodel.html#object.\_\_del__

    @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
    type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants