Skip to content

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

Closed
Wojusensei wants to merge 61 commits into
python:mainfrom
Wojusensei:fix-thread-info-lock
Closed

Wojusensei wants to merge 61 commits into
python:mainfrom
Wojusensei:fix-thread-info-lock

Conversation

@Wojusensei

Copy link
Copy Markdown
Contributor

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.

3 similar comments
@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.

@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
Contributor Author

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

Thanks! :)

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

@Wojusensei

Copy link
Copy Markdown
Contributor Author

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

@IvyXu420

IvyXu420 commented Jul 4, 2026

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
Contributor 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 :)

picnixz and others added 16 commits July 7, 2026 19:42
An abruptly closed empty comment ("<!-->" or "<!--->") no longer extends
up to a later "-->" in the same feed() call.

test_htmlparser now also feeds each string source as a single chunk, in
addition to one character at a time, to exercise different input buffering.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
* Use ANSI Escape Codes from Colorize

* Print ANSI Color reset on finish and restore

* 📜🤖 Added by blurb_it.

* Update imports

* Update Misc/NEWS.d/next/macOS/2026-06-24-18-00-39.gh-issue-152068.ThsmJU.rst

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>

* Remove news entry

* 📜🤖 Added by blurb_it.

* gh-152068: Test ANSI reset is emitted on console finish() and restore()

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ttp.cookiejar` docs (#152816)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
…ser (GH-153031)

When an unterminated construct (e.g. a tag or comment) spanned many
feed() calls, rescanning the growing buffer and concatenating new data
onto it were both quadratic.  New data is now accumulated in a list and
only joined and parsed once enough has piled up.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
util (line 27): root.tk_scaling method is new in 3.16.
This should have been included in PR-#152788.
Lazy keyword added to colorizer and test in PR-#142351.
Tested NameError hint expanded in PR-#144299.
Co-authored-by: Maciej Olko <maciej.olko@affirm.com>
Argument quoting was inadvertently disabled when imaplib was ported to
Python 3 (bpo-1210 commented out the ``_checkquote()`` call, bpo-9638
then removed it), so since Python 3.0 commands failed for arguments
containing protocol-sensitive characters, such as a space in a mailbox
name.

Quoting is restored and reimplemented per the RFC 3501 grammar, so that
arguments that need quoting are escaped and quoted, while flags, sequence
sets and list wildcards are left intact.

For backward compatibility, an argument already enclosed in double quotes
is left unchanged, so code that quotes arguments itself keeps working.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…H-153072)

The example pattern does not fail to match '<user@host.com' outright --
re.search finds 'user@host.com' in it; it only fails to match the
whole string.  Reword to say so.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Milan Oberkirch <zvyn@oberkirch.org>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@python-cla-bot

python-cla-bot Bot commented Jul 7, 2026 •

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

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