GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-46730: Fix refleak and tighten NULL checks by tiran · Pull Request #31389 · python/cpython

Conversation

@tiran

@tiran tiran commented Feb 17, 2022 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

PyType_GetQualName returns a new reference.

Signed-off-by: Christian Heimes [email protected]

https://bugs.python.org/issue46730

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@tiran
bpo-46730: Fix refleak and tighten NULL checks
a22802e
``PyType_GetQualName`` returns a new reference.

Signed-off-by: Christian Heimes <[email protected]>
@tiran tiran added the skip news label Feb 17, 2022
@bedevere-bot bedevere-bot added the awaiting core review label Feb 17, 2022
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Feb 17, 2022
@tiran tiran mentioned this pull request Feb 17, 2022
bpo-46730: Add more info to @property AttributeError messages #31311
Merged
@sweeneyde

sweeneyde commented Feb 17, 2022

Copy link
Copy Markdown
Member

I'll try to be more cautious about ref-leaks in the future. Thanks for catching this!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@markshannon
markshannon marked this pull request as ready for review February 17, 2022 16:41
@markshannon markshannon added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Feb 17, 2022
@bedevere-bot

bedevere-bot commented Feb 17, 2022

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @markshannon for commit a22802e 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Feb 17, 2022
JelleZijlstra
JelleZijlstra approved these changes Feb 17, 2022
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels Feb 17, 2022
@sweeneyde
sweeneyde merged commit 9e06d03 into python:main Feb 17, 2022
@bedevere-bot bedevere-bot removed the awaiting merge label Feb 17, 2022
@tiran

tiran commented Feb 17, 2022

Copy link
Copy Markdown
Member Author

@sweeneyde The buildbots have not finished verifying this PR yet. Next time please wait until all buildbots are successful.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sweeneyde

sweeneyde commented Feb 17, 2022

Copy link
Copy Markdown
Member

Ah, my apologies, I was just looking at the refleak bots. I will wait next time. Thank you for the help!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland erlend-aasland mentioned this pull request Feb 17, 2022
bpo-46765: Replace Locally Cached Strings with Statically Initialized Objects #31366
Merged
@Alex-Blade

Alex-Blade commented Feb 18, 2022

Copy link
Copy Markdown
Contributor

Oh, apologies, should have checked that

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@geryogam

geryogam commented May 22, 2023

Copy link
Copy Markdown
Contributor

@tiran In which case could you have the last error message "AttributeError: property has no getter" that you introduced in the else clause? In other words, when does PyType_GetQualName(Py_TYPE(obj)) return NULL in C?

I can’t get that error message by making hasattr(type(obj), "__qualname__") return False in Python:

class M(type):
    def __getattribute__(self, name): raise AttributeError

class A(metaclass=M): pass

obj = A()
hasattr(type(obj), "__qualname__") # returns False
property().__get__(obj)  # raises AttributeError: property of 'A' object has no getter

It seems that property().__get__(obj) uses vars(type)["__qualname__"].__get__(type(obj)) (which returns 'A') and not type(obj).__qualname__ (which raises AttributeError) to get the __qualname__ attribute of type(obj).

So is your else clause dead code?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@JelleZijlstra JelleZijlstra JelleZijlstra approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

8 participants

@tiran @sweeneyde @bedevere-bot @Alex-Blade @geryogam @JelleZijlstra @markshannon @the-knights-who-say-ni
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.