Skip to content

[3.6] bpo-27535: Fix memory leak with warnings ignore (GH-4489)#4587

Closed
miss-islington wants to merge 1 commit intopython:3.6from
miss-islington:backport-c975878-3.6
Closed

[3.6] bpo-27535: Fix memory leak with warnings ignore (GH-4489)#4587
miss-islington wants to merge 1 commit intopython:3.6from
miss-islington:backport-c975878-3.6

Conversation

@miss-islington
Copy link
Copy Markdown
Contributor

@miss-islington miss-islington commented Nov 27, 2017

The warnings module doesn't leak memory anymore in the hidden
warnings registry for the "ignore" action of warnings filters.

The warn_explicit() function doesn't add the warning key to the
registry anymore for the "ignore" action.
(cherry picked from commit c975878)

https://bugs.python.org/issue27535

The warnings module doesn't leak memory anymore in the hidden
warnings registry for the "ignore" action of warnings filters.

The warn_explicit() function doesn't add the warning key to the
registry anymore for the "ignore" action.
(cherry picked from commit c975878)
@miss-islington
Copy link
Copy Markdown
Contributor Author

@vstinner: Backport status check is done, and it's a success ✅ .

@vstinner
Copy link
Copy Markdown
Member

This change makes warning.warn() 1.4x slower on Python 3.6 for the ignore action: https://bugs.python.org/issue27535#msg307165

I don't think that the memory leak issue is important enough to justify such slowdown in a stable branch. So I close my PR.

@vstinner vstinner closed this Nov 28, 2017
@miss-islington miss-islington deleted the backport-c975878-3.6 branch November 28, 2017 20:50
@thehesiod
Copy link
Copy Markdown
Contributor

thehesiod commented May 23, 2018

this was a very bad decision, now the 3.6 branches leak without most people knowing why. Especially when using botocore when using certain operations. Could someone please find a way to bring this to 3.6 in a performant manner?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants