Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-31370: Remove support for threads-less builds #3385

Merged
merged 10 commits into from
Sep 7, 2017

Conversation

pitrou
Copy link
Member

@pitrou pitrou commented Sep 6, 2017

Copy link
Member

@gpshead gpshead left a comment

Choose a reason for hiding this comment

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

yay! i skimmed over everything, it looks good. lots of mechanical changes. :)

@pitrou pitrou changed the title [WIP] Remove support for threads-less builds [WIP] bpo-31370: Remove support for threads-less builds Sep 6, 2017
@pitrou pitrou changed the title [WIP] bpo-31370: Remove support for threads-less builds bpo-31370: Remove support for threads-less builds Sep 6, 2017
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

Please keep the "#define WITH_THREAD 1" for backward compatibily. Maybe in pyport.h?

LGTM if you keep the define, but I would like to see a review of another core dev like @ericsnowcurrently.

See https://bugs.python.org/issue27961#msg276881 and commit a251fb0.

Copy link
Member

@bitdancer bitdancer left a comment

Choose a reason for hiding this comment

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

The test_email change looks fine :)

I think this needs a mention in What's New as well.

@pitrou pitrou requested a review from a team as a code owner September 7, 2017 10:41
@pitrou
Copy link
Member Author

pitrou commented Sep 7, 2017

Please keep the "#define WITH_THREAD 1" for backward compatibily. Maybe in pyport.h?

Ok, done.

@pitrou
Copy link
Member Author

pitrou commented Sep 7, 2017

I think this needs a mention in What's New as well.

Ok, done.

@vstinner vstinner merged commit a6a4dc8 into python:master Sep 7, 2017
@vstinner
Copy link
Member

vstinner commented Sep 7, 2017

Thanks, I merged your change ;-)

@mscuthbert
Copy link

mscuthbert commented Sep 8, 2017

Ignore below; forgot to copy Modules/Setup.dist to Modules/Setup

Anyone else getting this error when trying to build Python on OS X after the merge?

File "/Users/cuthbert/git/cpython/Lib/reprlib.py", line 7, in <module>
    from _thread import get_ident
ModuleNotFoundError: No module named '_thread'

It seems that _thread is no longer being made in the build process.

Full part of the make process:

./python.exe -E -S -m sysconfig --generate-posix-vars ;\
	if test $? -ne 0 ; then \
		echo "generate-posix-vars failed" ; \
		rm -f ./pybuilddir.txt ; \
		exit 1 ; \
	fi
Could not import runpy module
Traceback (most recent call last):
  File "/Users/cuthbert/git/cpython/Lib/runpy.py", line 14, in <module>
    import importlib.machinery # importlib first so we can test #15386 via -m
  File "/Users/cuthbert/git/cpython/Lib/importlib/__init__.py", line 57, in <module>
    import types
  File "/Users/cuthbert/git/cpython/Lib/types.py", line 175, in <module>
    import functools as _functools
  File "/Users/cuthbert/git/cpython/Lib/functools.py", line 21, in <module>
    from collections import namedtuple
  File "/Users/cuthbert/git/cpython/Lib/collections/__init__.py", line 32, in <module>
    from reprlib import recursive_repr as _recursive_repr
  File "/Users/cuthbert/git/cpython/Lib/reprlib.py", line 7, in <module>
    from _thread import get_ident
ModuleNotFoundError: No module named '_thread'

ma8ma added a commit to ma8ma/cpython that referenced this pull request Sep 8, 2017
Resolve conflicts:
a6a4dc8 bpo-31370: Remove support for threads-less builds (python#3385)
mcepl pushed a commit to openSUSE-Python/cpython that referenced this pull request Apr 13, 2024
* Remove Setup.config
* Always define WITH_THREAD for compatibility.
cjwatson added a commit to cjwatson/pastescript that referenced this pull request Dec 8, 2024
python/cpython#109462 removed
`logging._acquireLock`.  Fortunately,
python/cpython#3385 simplified lock creation so
that `with logging._lock:` is sufficient; that PR made it into Python
3.7, which is already pastescript's minimum Python requirement.
cdent pushed a commit to pasteorg/pastescript that referenced this pull request Jan 22, 2025
python/cpython#109462 removed
`logging._acquireLock`.  Fortunately,
python/cpython#3385 simplified lock creation so
that `with logging._lock:` is sufficient; that PR made it into Python
3.7, which is already pastescript's minimum Python requirement.
jjhelmus added a commit to jjhelmus/conda that referenced this pull request Feb 11, 2025
Aquire the logging lock using the underlying _lock object from the
logging module.

As of python/cpython#3385, included in Python 3.7, this object an instance
of threading.RLock whose use as a context manager with release being
called when the block exits, see
https://docs.python.org/3/library/threading.html#using-locks-conditions-and-semaphores-in-the-with-statement
jezdez pushed a commit to conda/conda that referenced this pull request Feb 12, 2025
* aquire logging lock using _lock context manager

Aquire the logging lock using the underlying _lock object from the
logging module.

As of python/cpython#3385, included in Python 3.7, this object an instance
of threading.RLock whose use as a context manager with release being
called when the block exits, see
https://docs.python.org/3/library/threading.html#using-locks-conditions-and-semaphores-in-the-with-statement

* mark conda.common.io._logger_lock for deprecation

* add news

* Update news/14584-use-logging-lock

* Apply suggestions from code review

---------

Co-authored-by: Daniel Holth <dholth@anaconda.com>
Co-authored-by: Ken Odegard <kodegard@anaconda.com>
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.

8 participants