Skip to content

gh-152798: Revert sys.thread_info.lock to 'semaphore'/None for consistency#152994

Open
Wojusensei wants to merge 1 commit into
python:mainfrom
Wojusensei:fix-thread-info-lock
Open

gh-152798: Revert sys.thread_info.lock to 'semaphore'/None for consistency#152994
Wojusensei wants to merge 1 commit into
python:mainfrom
Wojusensei:fix-thread-info-lock

Conversation

@Wojusensei

Copy link
Copy Markdown

Closes gh-152798

this PR reverts the change made in GH-134747 and GH-141140 that set sys.thread_info.lock to "pymutex"

the underlying lock implementation (PyMutex) has been used since python 3.13.1 and 3.14, but changing this attribute in 3.15 was both late and misleading

this revert restores the values to match Python 3.14 behavior:

  • "semaphore" on POSIX platforms (linux, macOS, BSD, etc)
  • None on Windows and Emscripten

@bedevere-app

bedevere-app Bot commented Jul 4, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@bedevere-app

bedevere-app Bot commented Jul 4, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

1 similar comment
@bedevere-app

bedevere-app Bot commented Jul 4, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@Wojusensei Wojusensei force-pushed the fix-thread-info-lock branch from 674f38b to afd14a8 Compare July 4, 2026 08:39
@bedevere-app

bedevere-app Bot commented Jul 4, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@Wojusensei Wojusensei force-pushed the fix-thread-info-lock branch from afd14a8 to db0ac09 Compare July 4, 2026 08:43
@bedevere-app

bedevere-app Bot commented Jul 4, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@Wojusensei

Copy link
Copy Markdown
Author

could a maintainer plz add the skip news label? this is a tiny internal revert that doesn't affect users

Thanks! :)

@Wojusensei Wojusensei force-pushed the fix-thread-info-lock branch from db0ac09 to 547a1be Compare July 4, 2026 08:49
@bedevere-app

bedevere-app Bot commented Jul 4, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@Wojusensei Wojusensei force-pushed the fix-thread-info-lock branch from 547a1be to bb91678 Compare July 4, 2026 09:05
@bedevere-app

bedevere-app Bot commented Jul 4, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@Wojusensei

Copy link
Copy Markdown
Author

the Windows test_logging and test_tkinter failures appear to be unrelated to this change :(
could a maintainer plz take a look? Thanks!~

@ByteFlowing1337

Copy link
Copy Markdown
Contributor

Please don't force-push.
And yes, the failure of the test_logging is unrelated -- it's reported in #84649 (comment).

@Wojusensei

Copy link
Copy Markdown
Author

不要用力推。是的,故障与此无关——在#84649(评论)中报告。test_logging

thank u for taking a look! i wont force push on this PR anymore. and thanks for confirming the logging test is unrelated, that's good to know :)

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.

sys.thread_info.lock was changed to "pymutex" in 3.15, even though _thread.Lock had already switched to PyMutex in 3.14 and 3.13.1

2 participants