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

@vsajip vsajip commented Jan 4, 2024

Copy link
Copy Markdown
Member

@vsajip vsajip added the tests Tests in the Lib/test dir label Jan 4, 2024
@vsajip vsajip 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-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jan 4, 2024
@vsajip vsajip 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-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jan 5, 2024
@vsajip
vsajip requested a review from brettcannon January 5, 2024 09:00

@hauntsaninja hauntsaninja 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

vsajip commented Jan 7, 2024

Copy link
Copy Markdown
Member Author

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. 

@brettcannon brettcannon 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:main Jan 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

bedevere-app Bot commented Jan 9, 2024

Copy link
Copy Markdown

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

@bedevere-app bedevere-app Bot 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

vsajip commented Jan 9, 2024

Copy link
Copy Markdown
Member Author

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 free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants