Skip to content

gh-113692: skip a test if multiprocessing isn't available. - #113704

Merged
vsajip merged 2 commits into
python:mainfrom
vsajip:fix-113692
Jan 9, 2024
Merged

gh-113692: skip a test if multiprocessing isn't available.#113704
vsajip merged 2 commits into
python:mainfrom
vsajip:fix-113692

Conversation

@vsajip

@vsajipvsajip commented Jan 4, 2024

Copy link
Copy Markdown
Member

@vsajipvsajip added the tests Tests in the Lib/test dir label Jan 4, 2024
@vsajipvsajip added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jan 4, 2024
@bedevere-bot

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @vsajip for commit e923a3b 🤖

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

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jan 4, 2024
@vsajipvsajip added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jan 5, 2024
@bedevere-bot

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @vsajip for commit 0cb39ea 🤖

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

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jan 5, 2024

@hauntsaninjahauntsaninja left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good!

(should we set required_on to at least one platform as typo protection?)

@vsajip

Copy link
Copy Markdown
MemberAuthor

Looks good!
(should we set required_on to at least one platform as typo protection?)

Thanks. Do you think that's needed for this specific issue? It seems a simple enough change. Not sure what you mean by typo protection. 

@brettcannonbrettcannon added the needs backport to 3.12 only security fixes label Jan 8, 2024
@brettcannon

Copy link
Copy Markdown
Member

Not sure what you mean by typo protection.

I think @hauntsaninja is suggesting we require this pass on some platform to avoid a typo in the name of the module being imported since there's no error checking the module name is legitimate (although could that check be added thanks to sys.stdlib_module_names?).

@vsajip I added the backport label as I think this needs to land in 3.12 as well.

@vsajip
vsajip merged commit 842b738 into python:mainJan 9, 2024
@miss-islington-app

Copy link
Copy Markdown

Thanks @vsajip for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 9, 2024
…honGH-113704)
(cherry picked from commit 842b738)
Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
@vsajip
vsajip deleted the fix-113692 branch January 9, 2024 07:47
@bedevere-app

Copy link
Copy Markdown

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

@bedevere-appbedevere-appBot removed the needs backport to 3.12 only security fixes label Jan 9, 2024
vsajip pushed a commit that referenced this pull request Jan 9, 2024
@hauntsaninja

hauntsaninja commented Jan 9, 2024

Copy link
Copy Markdown
Contributor

Yup, that's what I meant :-) Looks like sys.stdlib_module_names won't do the trick, it doesn't include things like _xxsubinterpreters or _wmi (and works less well for e.g. concurrent.futures)

@vsajip

Copy link
Copy Markdown
MemberAuthor

Perhaps import_helper.import_module could be enhanced to do these checks? Wouldn't that be the best place for such?

@hauntsaninja

hauntsaninja commented Jan 9, 2024

Copy link
Copy Markdown
Contributor

Yeah, I took Brett's suggestion to mean we add a check against sys.stdlib_module_names in import_helper.import_module. Doing that naively doesn't work for the reasons I mention above, and not sure this is important enough to make an allowlist for it or whatever.

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

Labels

skip newstestsTests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@vsajip@bedevere-bot@brettcannon@hauntsaninja