Skip to content

Commit

Permalink
Merge branch 'main' into arm-runners
Browse files Browse the repository at this point in the history
  • Loading branch information
diegorusso authored Nov 29, 2024
2 parents 5648245 + 3afb639 commit d3da915
Show file tree
Hide file tree
Showing 30 changed files with 1,096 additions and 247 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,8 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-24.04]
openssl_ver: [3.0.15, 3.1.7, 3.2.3, 3.3.2]
openssl_ver: [3.0.15, 3.1.7, 3.2.3, 3.3.2, 3.4.0]
# See Tools/ssl/make_ssl_data.py for notes on adding a new version
env:
OPENSSL_VER: ${{ matrix.openssl_ver }}
MULTISSL_DIR: ${{ github.workspace }}/multissl
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/reusable-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ jobs:
path: config.cache
key: ${{ github.job }}-${{ inputs.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }}
- name: Install Homebrew dependencies
run: brew install pkg-config openssl@3.0 xz gdbm tcl-tk make
run: |
brew install pkg-config openssl@3.0 xz gdbm tcl-tk@8 make
# Because alternate versions are not symlinked into place by default:
brew link tcl-tk@8
- name: Configure CPython
run: |
GDBM_CFLAGS="-I$(brew --prefix gdbm)/include" \
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/object.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Object Protocol
instead of the :func:`repr`.
.. c:function:: int PyObject_HasAttrWithError(PyObject *o, const char *attr_name)
.. c:function:: int PyObject_HasAttrWithError(PyObject *o, PyObject *attr_name)
Returns ``1`` if *o* has the attribute *attr_name*, and ``0`` otherwise.
This is equivalent to the Python expression ``hasattr(o, attr_name)``.
Expand Down
11 changes: 5 additions & 6 deletions Doc/library/ctypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2035,9 +2035,9 @@ Utility functions

.. function:: FormatError([code])

Returns a textual description of the error code *code*. If no
error code is specified, the last error code is used by calling the Windows
api function GetLastError.
Returns a textual description of the error code *code*. If no error code is
specified, the last error code is used by calling the Windows API function
:func:`GetLastError`.

.. availability:: Windows

Expand Down Expand Up @@ -2142,9 +2142,8 @@ Utility functions

.. function:: WinError(code=None, descr=None)

This function is probably the worst-named thing in ctypes. It
creates an instance of :exc:`OSError`. If *code* is not specified,
``GetLastError`` is called to determine the error code. If *descr* is not
Creates an instance of :exc:`OSError`. If *code* is not specified,
:func:`GetLastError` is called to determine the error code. If *descr* is not
specified, :func:`FormatError` is called to get a textual description of the
error.

Expand Down
7 changes: 7 additions & 0 deletions Doc/library/token.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ the :mod:`tokenize` module.
``type_comments=True``.


.. data:: EXACT_TOKEN_TYPES

A dictionary mapping the string representation of a token to its numeric code.

.. versionadded:: 3.8


.. versionchanged:: 3.5
Added :data:`!AWAIT` and :data:`!ASYNC` tokens.

Expand Down
12 changes: 4 additions & 8 deletions Lib/test/clinic.test.c
Original file line number Diff line number Diff line change
Expand Up @@ -5303,9 +5303,7 @@ Test_meth_coexist_impl(TestObj *self)
Test.property
[clinic start generated code]*/

#if defined(Test_property_HAS_DOCSTR)
# define Test_property_DOCSTR Test_property__doc__
#else
#if !defined(Test_property_DOCSTR)
# define Test_property_DOCSTR NULL
#endif
#if defined(TEST_PROPERTY_GETSETDEF)
Expand All @@ -5326,16 +5324,14 @@ Test_property_get(TestObj *self, void *Py_UNUSED(context))

static PyObject *
Test_property_get_impl(TestObj *self)
/*[clinic end generated code: output=27b519719d992e03 input=2d92b3449fbc7d2b]*/
/*[clinic end generated code: output=7cadd0f539805266 input=2d92b3449fbc7d2b]*/

/*[clinic input]
@setter
Test.property
[clinic start generated code]*/

#if defined(TEST_PROPERTY_HAS_DOCSTR)
# define Test_property_DOCSTR Test_property__doc__
#else
#if !defined(Test_property_DOCSTR)
# define Test_property_DOCSTR NULL
#endif
#if defined(TEST_PROPERTY_GETSETDEF)
Expand All @@ -5360,7 +5356,7 @@ Test_property_set(TestObj *self, PyObject *value, void *Py_UNUSED(context))

static int
Test_property_set_impl(TestObj *self, PyObject *value)
/*[clinic end generated code: output=d51023f17c4ac3a1 input=3bc3f46a23c83a88]*/
/*[clinic end generated code: output=e4342fe9bb1d7817 input=3bc3f46a23c83a88]*/

/*[clinic input]
output push
Expand Down
6 changes: 5 additions & 1 deletion Lib/test/test_asyncio/test_eager_task_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,14 @@ async def fail():
await asyncio.sleep(0)
raise ValueError("no good")

async def blocked():
fut = asyncio.Future()
await fut

async def run():
winner, index, excs = await asyncio.staggered.staggered_race(
[
lambda: asyncio.sleep(2, result="sleep2"),
lambda: blocked(),
lambda: asyncio.sleep(1, result="sleep1"),
lambda: fail()
],
Expand Down
15 changes: 15 additions & 0 deletions Lib/test/test_threading_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,21 @@ def test_threading_local_clear_race(self):

_testcapi.join_temporary_c_thread()

@support.cpython_only
def test_error(self):
class Loop(self._local):
attr = 1

# Trick the "if name == '__dict__':" test of __setattr__()
# to always be true
class NameCompareTrue:
def __eq__(self, other):
return True

loop = Loop()
with self.assertRaisesRegex(AttributeError, 'Loop.*read-only'):
loop.__setattr__(NameCompareTrue(), 2)


class ThreadLocalTest(unittest.TestCase, BaseLocalTest):
_local = _thread._local
Expand Down
3 changes: 2 additions & 1 deletion Lib/token.py

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

1 change: 1 addition & 0 deletions Misc/ACKS
Original file line number Diff line number Diff line change
Expand Up @@ -1154,6 +1154,7 @@ Mark Lutz
Taras Lyapun
Jim Lynch
Mikael Lyngvig
Ilya Lyubavski
Jeff MacDonald
John Machin
Andrew I MacIntyre
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Optimize decoding of short UTF-8 sequences containing non-ASCII characters
by approximately 15%.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix crash in finalization of dtoa state. Patch by Kumar Aditya.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
:mod:`ssl` can show descriptions for errors added in OpenSSL 3.4.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Publicly expose :data:`~token.EXACT_TOKEN_TYPES` in :attr:`!token.__all__`.
14 changes: 4 additions & 10 deletions Modules/_io/clinic/bufferedio.c.h

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

14 changes: 4 additions & 10 deletions Modules/_io/clinic/stringio.c.h

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

44 changes: 13 additions & 31 deletions Modules/_io/clinic/textio.c.h

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

3 changes: 2 additions & 1 deletion Modules/_ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,9 @@ static void _PySSLFixErrno(void) {
#endif

/* Include generated data (error codes) */
/* See make_ssl_data.h for notes on adding a new version. */
#if (OPENSSL_VERSION_NUMBER >= 0x30100000L)
#include "_ssl_data_31.h"
#include "_ssl_data_34.h"
#elif (OPENSSL_VERSION_NUMBER >= 0x30000000L)
#include "_ssl_data_300.h"
#elif (OPENSSL_VERSION_NUMBER >= 0x10101000L)
Expand Down
4 changes: 3 additions & 1 deletion Modules/_ssl_data_111.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/* File generated by Tools/ssl/make_ssl_data.py *//* Generated on 2023-06-01T02:58:04.081473 */
/* File generated by Tools/ssl/make_ssl_data.py */
/* Generated on 2024-11-27T12:48:46.194048+00:00 */
/* Generated from Git commit OpenSSL_1_1_1w-0-ge04bd3433f */
static struct py_ssl_library_code library_codes[] = {
#ifdef ERR_LIB_ASN1
{"ASN1", ERR_LIB_ASN1},
Expand Down
5 changes: 4 additions & 1 deletion Modules/_ssl_data_300.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/* File generated by Tools/ssl/make_ssl_data.py *//* Generated on 2023-06-01T03:03:52.163218 */
/* File generated by Tools/ssl/make_ssl_data.py */
/* Generated on 2023-06-01T03:03:52.163218 */
/* Manually edited to add definitions from 1.1.1 (GH-105174) */

static struct py_ssl_library_code library_codes[] = {
#ifdef ERR_LIB_ASN1
{"ASN1", ERR_LIB_ASN1},
Expand Down
Loading

0 comments on commit d3da915

Please sign in to comment.