Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/reusable-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ jobs:
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
- name: Install Homebrew dependencies
run: |
brew install pkg-config openssl@3.5 xz gdbm tcl-tk@9 make
# Because alternate versions are not symlinked into place by default:
brew link --overwrite tcl-tk@9
brew bundle --file=Misc/Brewfile
brew install make
- name: Configure CPython
run: |
MACOSX_DEPLOYMENT_TARGET=10.15 \
Expand Down
4 changes: 2 additions & 2 deletions Doc/library/codecs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1155,7 +1155,7 @@ particular, the following variants typically exist:
+-----------------+--------------------------------+--------------------------------+
| cp857 | 857, IBM857 | Turkish |
+-----------------+--------------------------------+--------------------------------+
| cp858 | 858, IBM858 | Western Europe |
| cp858 | 858, IBM00858 | Western Europe |
+-----------------+--------------------------------+--------------------------------+
| cp860 | 860, IBM860 | Portuguese |
+-----------------+--------------------------------+--------------------------------+
Expand Down Expand Up @@ -1192,7 +1192,7 @@ particular, the following variants typically exist:
| | | |
| | | .. versionadded:: 3.4 |
+-----------------+--------------------------------+--------------------------------+
| cp1140 | ibm1140 | Western Europe |
| cp1140 | IBM01140 | Western Europe |
+-----------------+--------------------------------+--------------------------------+
| cp1250 | windows-1250 | Central and Eastern Europe |
+-----------------+--------------------------------+--------------------------------+
Expand Down
1 change: 1 addition & 0 deletions Doc/tools/extensions/pydoc_topics.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"in",
"integers",
"lambda",
"lazy",
"lists",
"naming",
"nonlocal",
Expand Down
4 changes: 3 additions & 1 deletion Lib/ctypes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,9 +549,11 @@ def LoadLibrary(self, name):

if _os.name == "nt":
pythonapi = PyDLL("python dll", None, _sys.dllhandle)
elif _sys.platform in ["android", "cygwin"]:
elif _sys.platform == "android":
# These are Unix-like platforms which use a dynamically-linked libpython.
pythonapi = PyDLL(_sysconfig.get_config_var("LDLIBRARY"))
elif _sys.platform == "cygwin":
pythonapi = PyDLL(_sysconfig.get_config_var("DLLLIBRARY"))
else:
pythonapi = PyDLL(None)

Expand Down
8 changes: 8 additions & 0 deletions Lib/encodings/aliases.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@

# cp1140 codec
'1140' : 'cp1140',
'cp01140' : 'cp1140',
'csibm01140' : 'cp1140',
'ebcdic_us_37_euro' : 'cp1140',
'ibm01140' : 'cp1140',
'ibm1140' : 'cp1140',

# cp1250 codec
Expand Down Expand Up @@ -159,8 +163,12 @@

# cp858 codec
'858' : 'cp858',
'cp00858' : 'cp858',
'csibm00858' : 'cp858',
'csibm858' : 'cp858',
'ibm00858' : 'cp858',
'ibm858' : 'cp858',
'pc_multilingual_850_euro' : 'cp858',

# cp860 codec
'860' : 'cp860',
Expand Down
1 change: 1 addition & 0 deletions Lib/pydoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1845,6 +1845,7 @@ class Helper:
'in': ('in', 'SEQUENCEMETHODS'),
'is': 'COMPARISON',
'lambda': ('lambda', 'FUNCTIONS'),
'lazy': ('lazy', 'MODULES'),
'nonlocal': ('nonlocal', 'global NAMESPACES'),
'not': 'BOOLEAN',
'or': 'BOOLEAN',
Expand Down
8 changes: 5 additions & 3 deletions Lib/test/test_pwd.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,11 @@ def test_errors(self):
self.assertNotIn(fakeuid, byuids)
self.assertRaises(KeyError, pwd.getpwuid, fakeuid)

# -1 shouldn't be a valid uid because it has a special meaning in many
# uid-related functions
self.assertRaises(KeyError, pwd.getpwuid, -1)
# On Cygwin, getpwuid(-1) returns 'Unknown+User' user
if sys.platform != 'cygwin':
# -1 shouldn't be a valid uid because it has a special meaning in many
# uid-related functions
self.assertRaises(KeyError, pwd.getpwuid, -1)
# should be out of uid_t range
self.assertRaises(KeyError, pwd.getpwuid, 2**128)
self.assertRaises(KeyError, pwd.getpwuid, -2**128)
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_pydoc/test_pydoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2172,7 +2172,7 @@ def mock_getline(prompt):

def test_keywords(self):
self.assertEqual(sorted(pydoc.Helper.keywords),
sorted(keyword.kwlist))
sorted(keyword.kwlist + ['lazy']))

def test_interact_empty_line_continues(self):
# gh-138568: test pressing Enter without input should continue in help session
Expand Down
12 changes: 6 additions & 6 deletions Lib/test/test_venv.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,9 @@ def test_sysconfig(self):
self.assertEqual(out.strip(), expected, err)
for attr, expected in (
('executable', self.envpy()),
# Usually compare to sys.executable, but if we're running in our own
# venv then we really need to compare to our base executable
('_base_executable', sys._base_executable),
# Usually compare to sys.prefix, but if we're running in our own
# venv then we really need to compare to our base prefix
('base_prefix', sys.base_prefix),
):
with self.subTest(attr):
cmd[2] = f'import sys; print(sys.{attr})'
Expand Down Expand Up @@ -916,10 +916,10 @@ def test_venvwlauncher(self):
exename = exename.replace("python", "pythonw")
envpyw = os.path.join(self.env_dir, self.bindir, exename)
try:
subprocess.check_call([envpyw, "-c", "import sys; "
"assert sys._base_executable.endswith('%s')" % exename])
subprocess.check_call([envpyw, "-c", "import fnmatch, sys; "
"assert fnmatch.fnmatch(sys._base_executable, '**/pythonw*.exe')"])
except subprocess.CalledProcessError:
self.fail("venvwlauncher.exe did not run %s" % exename)
self.fail("venvwlauncher.exe did not run pythonw.exe")


@requireVenvCreate
Expand Down
15 changes: 15 additions & 0 deletions Misc/Brewfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
brew "gdbm"
brew "mpdecimal"
brew "openssl@3.5"
brew "pkg-config"
brew "tcl-tk@9"
brew "xz"
brew "zstd"

brew "bzip2" if OS.linux?
brew "expat" if OS.linux?
brew "libedit" if OS.linux?
brew "libffi" if OS.linux?
brew "ncurses" if OS.linux?
brew "unzip" if OS.linux?
brew "zlib-ng-compat" if OS.linux?
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a race condition in :class:`memoryview` with free-threading.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Add IANA registered names and aliases with leading zeros before number (like
IBM00858, CP00858, IBM01140, CP01140) for corresponding codecs.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add :keyword:`lazy` to the list of support topic by :func:`help`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Windows distributions now include a :file:`build-details.json` file (see
:pep:`739`). The legacy installer does not install it, but all other
distributions from python.org and all preset configurations in the
``PC\layout`` script will include one.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixes virtual environment launchers on Windows free-threaded builds.
16 changes: 8 additions & 8 deletions Misc/sbom.spdx.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Modules/_hacl/Lib_Memzero0.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <string.h>
#endif

#if defined(__FreeBSD__) || defined(__NetBSD__)
#if defined(__CYGWIN__) || defined(__FreeBSD__) || defined(__NetBSD__)
#include <strings.h>
#endif

Expand All @@ -57,7 +57,7 @@ void Lib_Memzero0_memzero0(void *dst, uint64_t len) {
SecureZeroMemory(dst, len_);
#elif defined(__APPLE__) && defined(__MACH__) && defined(APPLE_HAS_MEMSET_S)
memset_s(dst, len_, 0, len_);
#elif (defined(__linux__) && !defined(LINUX_NO_EXPLICIT_BZERO)) || defined(__FreeBSD__) || defined(__OpenBSD__)
#elif (defined(__linux__) && !defined(LINUX_NO_EXPLICIT_BZERO)) || defined(__CYGWIN__) || defined(__FreeBSD__) || defined(__OpenBSD__)
explicit_bzero(dst, len_);
#elif defined(__NetBSD__)
explicit_memset(dst, 0, len_);
Expand Down
12 changes: 12 additions & 0 deletions Modules/_hacl/libintvector.h
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,18 @@ vector128 Lib_IntVector_Intrinsics_vec128_xor(vector128 x0, vector128 x1) {
#if defined(HACL_CAN_COMPILE_VEC128)

#include <altivec.h>

/* GCC's AltiVec extension hijacks 'bool' as '__vector __bool int'.
Restore C99/C11 scalar bool for HACL* code. */
#if defined(__GNUC__) && !defined(__clang__)
#undef bool
#define bool _Bool
#undef true
#define true 1
#undef false
#define false 0
#endif

#include <string.h> // for memcpy
#include <stdint.h>

Expand Down
2 changes: 1 addition & 1 deletion Modules/_hacl/refresh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ fi

# Update this when updating to a new version after verifying that the changes
# the update brings in are good.
expected_hacl_star_rev=8ba599b2f6c9701b3dc961db895b0856a2210f76
expected_hacl_star_rev=504c2987452f87fe44bce9b9f12e19d6e051761f

hacl_dir="$(realpath "$1")"
cd "$(dirname "$0")"
Expand Down
20 changes: 6 additions & 14 deletions Objects/memoryobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -1629,11 +1629,7 @@ memory_getbuf(PyObject *_self, Py_buffer *view, int flags)


view->obj = Py_NewRef(self);
#ifdef Py_GIL_DISABLED
_Py_atomic_add_ssize(&self->exports, 1);
#else
self->exports++;
#endif
FT_ATOMIC_ADD_SSIZE(self->exports, 1);

return 0;
}
Expand All @@ -1642,11 +1638,7 @@ static void
memory_releasebuf(PyObject *_self, Py_buffer *view)
{
PyMemoryViewObject *self = (PyMemoryViewObject *)_self;
#ifdef Py_GIL_DISABLED
_Py_atomic_add_ssize(&self->exports, -1);
#else
self->exports--;
#endif
FT_ATOMIC_ADD_SSIZE(self->exports, -1);
return;
/* PyBuffer_Release() decrements view->obj after this function returns. */
}
Expand Down Expand Up @@ -2434,9 +2426,9 @@ memoryview_hex_impl(PyMemoryViewObject *self, PyObject *sep,
// Prevent 'self' from being freed if computing len(sep) mutates 'self'
// in _Py_strhex_with_sep().
// See: https://github.com/python/cpython/issues/143195.
self->exports++;
FT_ATOMIC_ADD_SSIZE(self->exports, 1);
PyObject *ret = _Py_strhex_with_sep(src->buf, src->len, sep, bytes_per_sep);
self->exports--;
FT_ATOMIC_ADD_SSIZE(self->exports, -1);
return ret;
}

Expand Down Expand Up @@ -3363,9 +3355,9 @@ memory_hash(PyObject *_self)
if (view->obj != NULL) {
// Prevent 'self' from being freed when computing the item's hash.
// See https://github.com/python/cpython/issues/142664.
self->exports++;
FT_ATOMIC_ADD_SSIZE(self->exports, 1);
Py_hash_t h = PyObject_Hash(view->obj);
self->exports--;
FT_ATOMIC_ADD_SSIZE(self->exports, -1);
if (h == -1) {
/* Keep the original error message */
return -1;
Expand Down
4 changes: 4 additions & 0 deletions PC/layout/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
__path__ = [str(Path(__file__).resolve().parent)]

from .support.appxmanifest import *
from .support.builddetails import *
from .support.catalog import *
from .support.constants import *
from .support.filesets import *
Expand Down Expand Up @@ -317,6 +318,9 @@ def _c(d):
for dest, src in get_appx_layout(ns):
yield dest, src

for dest, src in get_builddetails(ns):
yield dest, src

if ns.include_cat:
if ns.flat_dlls:
yield ns.include_cat.name, ns.include_cat
Expand Down
Loading
Loading