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 — gh-102251: Explicitly free state for test modules with state in test_import by sunmy2019 · Pull Request #105085 · python/cpython

Conversation

@sunmy2019

@sunmy2019 sunmy2019 commented May 30, 2023 •
edited by bedevere-bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

The module state is not cleared in the clean-up functions. This PR adds one clean-up function for it.

This fixes the second issue mentioned in #103879 (comment)

  • Issue: Fix Refleak in test_import #102251

Sorry, something went wrong.

Uh oh!

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

All reactions
@sunmy2019
clear module state after use
f4de1f7
@sunmy2019
sunmy2019 requested review from ericsnowcurrently and erlend-aasland May 30, 2023 09:54
@sunmy2019
sunmy2019 requested review from brettcannon, encukou, ncoghlan and warsaw as code owners May 30, 2023 09:54
@bedevere-bot bedevere-bot added the awaiting review label May 30, 2023
@bedevere-bot bedevere-bot mentioned this pull request May 30, 2023
Fix Refleak in test_import #102251
Closed
@erlend-aasland

erlend-aasland commented May 30, 2023

Copy link
Copy Markdown
Contributor

Can you update the PR title to reflect the actual change?

All reactions

Sorry, something went wrong.

Uh oh!

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

@sunmy2019 sunmy2019 changed the title gh-102251: Fix ref leaks in test_import gh-102251: Add clean-up function for _testsinglephase_with_state May 30, 2023
@erlend-aasland erlend-aasland added skip news needs backport to 3.12 only security fixes labels May 30, 2023
erlend-aasland
erlend-aasland reviewed May 30, 2023
View reviewed changes
Comment thread Modules/_testsinglephase.c Resolved

Uh oh!

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

@erlend-aasland
PEP 7
bd32c13
erlend-aasland
erlend-aasland reviewed May 30, 2023
View reviewed changes
Comment thread Lib/test/test_import/__init__.py Resolved

Uh oh!

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

Comment thread Lib/test/test_import/__init__.py Resolved

Uh oh!

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

@sunmy2019
use unittest.addCleanup
ac72ac4
sunmy2019
sunmy2019 commented May 30, 2023
View reviewed changes
Comment thread Modules/_testsinglephase.c Resolved

Uh oh!

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

@sunmy2019
Update Modules/_testsinglephase.c
764be66
sunmy2019
sunmy2019 commented May 30, 2023
View reviewed changes
Comment thread Lib/test/test_import/__init__.py Resolved

Uh oh!

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

@sunmy2019
Update Lib/test/test_import/__init__.py
52f46f2
sunmy2019
sunmy2019 commented May 30, 2023
View reviewed changes
Comment thread Lib/test/test_import/__init__.py Resolved

Uh oh!

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

@sunmy2019
Update Lib/test/test_import/__init__.py
daebdf7
erlend-aasland
erlend-aasland reviewed May 30, 2023
View reviewed changes
Comment thread Lib/test/test_import/__init__.py Resolved

Uh oh!

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

@sunmy2019 @erlend-aasland
Update Lib/test/test_import/__init__.py
a0f5bb7
Co-authored-by: Erlend E. Aasland <[email protected]>
erlend-aasland
erlend-aasland reviewed May 30, 2023
View reviewed changes
Comment thread Lib/test/test_import/__init__.py Resolved

Uh oh!

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

@sunmy2019
tell by has_state instead of name
26a9ede
@erlend-aasland erlend-aasland added the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label May 30, 2023
@bedevere-bot

bedevere-bot commented May 30, 2023

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @erlend-aasland for commit 26a9ede 🤖

If you want to schedule another build, you need to add the 🔨 test-with-refleak-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-refleak-buildbots Test PR w/ refleak buildbots; report in status section label May 30, 2023
@brettcannon
brettcannon removed their request for review May 30, 2023 19:19
@sunmy2019 sunmy2019 mentioned this pull request May 31, 2023
gh-102251: add missing cleanups for test_import #104796
Closed
@erlend-aasland erlend-aasland changed the title gh-102251: Add clean-up function for _testsinglephase_with_state gh-102251: Explicitly free state for test modules with state in test_import May 31, 2023
erlend-aasland
erlend-aasland approved these changes May 31, 2023
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting review labels May 31, 2023
@erlend-aasland

erlend-aasland commented May 31, 2023

Copy link
Copy Markdown
Contributor

Approved by Eric in #104796 (review), as part of a larger PR.

All reactions

Sorry, something went wrong.

Uh oh!

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

@erlend-aasland
erlend-aasland merged commit a99b9d9 into python:main May 31, 2023
@miss-islington

miss-islington commented May 31, 2023

Copy link
Copy Markdown
Contributor

Thanks @sunmy2019 for the PR, and @erlend-aasland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot bedevere-bot removed the awaiting merge label May 31, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 31, 2023
@sunmy2019 @erlend-aasland @miss-islington
pythongh-102251: Explicitly free state for test modules with state in…
4e1a1e1
… test_import (pythonGH-105085)

(cherry picked from commit a99b9d9)

Co-authored-by: sunmy2019 <[email protected]>
Co-authored-by: Erlend E. Aasland <[email protected]>
@bedevere-bot

bedevere-bot commented May 31, 2023

Copy link
Copy Markdown

GH-105170 is a backport of this pull request to the 3.12 branch.

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot bedevere-bot removed the needs backport to 3.12 only security fixes label May 31, 2023
erlend-aasland added a commit that referenced this pull request May 31, 2023
@miss-islington @sunmy2019 @erlend-aasland
[3.12] gh-102251: Explicitly free state for test modules with state i…
8b51666
…n test_import (GH-105085) (#105170)

(cherry picked from commit a99b9d9)

Co-authored-by: sunmy2019 <[email protected]>
Co-authored-by: Erlend E. Aasland <[email protected]>
sunmy2019 added a commit to sunmy2019/cpython that referenced this pull request Jun 1, 2023
@sunmy2019
rebase after changes to python#105085
695fd16
This was referenced Jun 2, 2023
gh-104614: Make Sure ob_type is Always Set Correctly by PyType_Ready() #105122
Merged
3.12 backport gh 105236 #105358
Closed
@sunmy2019
sunmy2019 deleted the gh-102251-2 branch June 23, 2023 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@erlend-aasland erlend-aasland erlend-aasland approved these changes
@ericsnowcurrently ericsnowcurrently Awaiting requested review from ericsnowcurrently ericsnowcurrently is a code owner
@encukou encukou Awaiting requested review from encukou
@ncoghlan ncoghlan Awaiting requested review from ncoghlan ncoghlan is a code owner
@warsaw warsaw Awaiting requested review from warsaw warsaw is a code owner

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.

4 participants

@sunmy2019 @erlend-aasland @bedevere-bot @miss-islington
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.