← 返回首页
bpo-45209: fix `UserWarning: resource_tracker` in test_multiprocessing by sobolevn · Pull Request #28377 · python/cpython · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

bpo-45209: fix UserWarning: resource_tracker in test_multiprocessing#28377

Merged
ambv merged 4 commits into
python:mainfrom
sobolevn:issue-45209
Sep 21, 2021
Merged

bpo-45209: fix UserWarning: resource_tracker in test_multiprocessing#28377
ambv merged 4 commits into
python:mainfrom
sobolevn:issue-45209

Conversation

sobolevn commented Sep 15, 2021
edited
Loading

Copy link
Copy Markdown
Member

Copy link
Copy Markdown
Member

cc @pitrou

pitrou changed the title bpo-45209: removes UserWarning: resource_tracker in `test_multiproc… bpo-45209: fix UserWarning: resource_tracker in test_multiprocessing Sep 16, 2021
Comment thread Misc/NEWS.d/next/Tests/2021-09-15-23-32-39.bpo-45209.55ntL5.rst Outdated Show resolved Hide resolved

Copy link
Copy Markdown
Member

Windows build error on Azure Pipelines is tracked by: https://bugs.python.org/issue45220

Copy link
Copy Markdown
Member Author

Rebased, CI now passes.

vstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

LGTM. @pitrou: Would you mind to double check this multiprocessing test fix?

I'm kind of unhappy that you have to prepend "/". SharedMemory._prepend_leading_slash does a magic dance (add/remove "/" prefix) with SharedMemory(name) constructor parameter and in SharedMemory.name property. But I don't think that it's worth it to add something just for this very specific test. We can always revisit the code later if we start to have issue on some corner cases.

Comment thread Misc/NEWS.d/next/Tests/2021-09-15-23-32-39.bpo-45209.55ntL5.rst Show resolved Hide resolved

Copy link
Copy Markdown
Member Author

I'm kind of unhappy that you have to prepend "/". SharedMemory._prepend_leading_slash does a magic dance (add/remove "/" prefix) with SharedMemory(name) constructor parameter and in SharedMemory.name property

Yes, me too. I've tried several other things like smm.name (was not producing the correct result by raising KeyError). After several attempts this was the simplest solution. And since we only run this part on posix, it should work correctly.

Thanks, @vstinner and @pitrou

ambv commented Sep 21, 2021

Copy link
Copy Markdown
Contributor

Since the slash hack is tests-only, let's have it. We can fix the fix later if we find a way to do so.

ambv merged commit f604cf1 into python:main Sep 21, 2021
vstinner added the needs backport to 3.10 only security fixes label Sep 21, 2021

Copy link
Copy Markdown
Contributor

Thanks @sobolevn for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 21, 2021
pythonGH-28377) (cherry picked from commit f604cf1) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>

Copy link
Copy Markdown

GH-28499 is a backport of this pull request to the 3.10 branch.

Copy link
Copy Markdown
Contributor

Thanks @sobolevn for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9.
🐍🍒⛏🤖

Copy link
Copy Markdown

GH-28500 is a backport of this pull request to the 3.9 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 21, 2021
pythonGH-28377) (cherry picked from commit f604cf1) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
miss-islington added a commit that referenced this pull request Sep 21, 2021
GH-28377) (cherry picked from commit f604cf1) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
vstinner pushed a commit that referenced this pull request Sep 21, 2021
GH-28377) (GH-28500) (cherry picked from commit f604cf1) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

Footer

© 2026 GitHub, Inc.