pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: https://github.com/python/cpython/issues/96352

ets.com/assets/repository-5c3491d57145b94f.css" /> `object.__getattribute__` does not set `name` and `obj` of `AttributeError` · Issue #96352 · python/cpython · GitHub
Skip to content

object.__getattribute__ does not set name and obj of AttributeError #96352

@philg314

Description

@philg314

Bug report

object.__getattribute__ does not set name and obj of AttributeError:

class Test: pass
test = Test()

try:
    print("test.a")
    test.a
except AttributeError as e:
    print(f"{e=}")
    print(f"{e.name=}")
    print(f"{e.obj=}")

print()

try:
    print('object.__getattribute__(test, "a")')
    object.__getattribute__(test, "a")
except AttributeError as e:
    print(f"{e=}")
    print(f"{e.name=}")
    print(f"{e.obj=}")

Output:

test.a
e=AttributeError("'Test' object has no attribute 'a'")
e.name='a'
e.obj=<__main__.Test object at 0x7f2fc87a8760>

object.__getattribute__(test, "a")
e=AttributeError("'Test' object has no attribute 'a'")
e.name=None
e.obj=None
  • CPython versions tested on: Python 3.10.5, Python 3.12.0a0

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





      Check this box to remove all script contents from the fetched content.



      Check this box to remove all images from the fetched content.


      Check this box to remove all CSS styles from the fetched content.


      Check this box to keep images inefficiently compressed and original size.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy