Skip to content

Commit

Permalink
Merge branch 'main' into pathlib-abc-raw-path
Browse files Browse the repository at this point in the history
  • Loading branch information
barneygale authored Jan 13, 2024
2 parents 27039e8 + e4ff131 commit f57420d
Show file tree
Hide file tree
Showing 121 changed files with 1,040 additions and 679 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ jobs:
- name: Configure ccache action
uses: hendrikmuhs/[email protected]
with:
save: ${{ github.event_name == 'push' }}
save: false
- name: Check Autoconf and aclocal versions
run: |
grep "Generated by GNU Autoconf 2.71" configure
Expand Down Expand Up @@ -287,7 +287,7 @@ jobs:
- name: Configure ccache action
uses: hendrikmuhs/[email protected]
with:
save: ${{ github.event_name == 'push' }}
save: false
- name: Configure CPython
run: ./configure --config-cache --with-pydebug --with-openssl=$OPENSSL_DIR
- name: Build CPython
Expand Down Expand Up @@ -332,7 +332,7 @@ jobs:
- name: Configure ccache action
uses: hendrikmuhs/[email protected]
with:
save: ${{ github.event_name == 'push' }}
save: false
- name: Setup directory envs for out-of-tree builds
run: |
echo "CPYTHON_RO_SRCDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-ro-srcdir)" >> $GITHUB_ENV
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/reusable-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
uses: hendrikmuhs/[email protected]
with:
save: ${{ github.event_name == 'push' }}
max-size: "200M"
- name: Setup directory envs for out-of-tree builds
run: |
echo "CPYTHON_RO_SRCDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-ro-srcdir)" >> $GITHUB_ENV
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ repos:
hooks:
- id: sphinx-lint
args: [--enable=default-role]
files: ^Doc/|^Misc/NEWS.d/next/
files: ^Doc/|^Misc/NEWS.d/

- repo: meta
hooks:
Expand Down
Binary file modified Doc/library/kde_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 24 additions & 6 deletions Doc/library/mmap.rst
Original file line number Diff line number Diff line change
Expand Up @@ -372,14 +372,25 @@ MAP_* Constants

.. data:: MAP_SHARED
MAP_PRIVATE
MAP_DENYWRITE
MAP_EXECUTABLE
MAP_32BIT
MAP_ALIGNED_SUPER
MAP_ANON
MAP_ANONYMOUS
MAP_CONCEAL
MAP_DENYWRITE
MAP_EXECUTABLE
MAP_HASSEMAPHORE
MAP_JIT
MAP_NOCACHE
MAP_NOEXTEND
MAP_NORESERVE
MAP_POPULATE
MAP_RESILIENT_CODESIGN
MAP_RESILIENT_MEDIA
MAP_STACK
MAP_ALIGNED_SUPER
MAP_CONCEAL
MAP_TPRO
MAP_TRANSLATED_ALLOW_EXECUTE
MAP_UNIX03

These are the various flags that can be passed to :meth:`mmap.mmap`. :data:`MAP_ALIGNED_SUPER`
is only available at FreeBSD and :data:`MAP_CONCEAL` is only available at OpenBSD. Note
Expand All @@ -392,5 +403,12 @@ MAP_* Constants
Added :data:`MAP_STACK` constant.

.. versionadded:: 3.12
Added :data:`MAP_ALIGNED_SUPER` constant.
Added :data:`MAP_CONCEAL` constant.
Added :data:`MAP_ALIGNED_SUPER` and :data:`MAP_CONCEAL` constants.

.. versionadded:: 3.13
Added :data:`MAP_32BIT`, :data:`MAP_HASSEMAPHORE`, :data:`MAP_JIT`,
:data:`MAP_NOCACHE`, :data:`MAP_NOEXTEND`, :data:`MAP_NORESERVE`,
:data:`MAP_RESILIENT_CODESIGN`, :data:`MAP_RESILIENT_MEDIA`,
:data:`MAP_TPRO`, :data:`MAP_TRANSLATED_ALLOW_EXECUTE`, and
:data:`MAP_UNIX03` constants.

8 changes: 6 additions & 2 deletions Doc/library/os.path.rst
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,16 @@ the :mod:`glob` module.)
.. function:: isabs(path)

Return ``True`` if *path* is an absolute pathname. On Unix, that means it
begins with a slash, on Windows that it begins with a (back)slash after chopping
off a potential drive letter.
begins with a slash, on Windows that it begins with two (back)slashes, or a
drive letter, colon, and (back)slash together.

.. versionchanged:: 3.6
Accepts a :term:`path-like object`.

.. versionchanged:: 3.13
On Windows, returns ``False`` if the given path starts with exactly one
(back)slash.


.. function:: isfile(path)

Expand Down
30 changes: 30 additions & 0 deletions Doc/library/tarfile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,36 @@ A ``TarInfo`` object has the following public data attributes:
:meth:`~TarFile.extractall`, causing extraction to skip applying this
attribute.

.. attribute:: TarInfo.chksum

Header checksum.


.. attribute:: TarInfo.devmajor

Device major number.


.. attribute:: TarInfo.devminor

Device minor number.


.. attribute:: TarInfo.offset

The tar header starts here.


.. attribute:: TarInfo.offset_data

The file's data starts here.


.. attribute:: TarInfo.sparse

Sparse member information.


.. attribute:: TarInfo.pax_headers
:type: dict

Expand Down
8 changes: 4 additions & 4 deletions Doc/library/unittest.mock.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2009,8 +2009,8 @@ Mocking Magic Methods
~~~~~~~~~~~~~~~~~~~~~

:class:`Mock` supports mocking the Python protocol methods, also known as
"magic methods". This allows mock objects to replace containers or other
objects that implement Python protocols.
:term:`"magic methods" <magic method>`. This allows mock objects to replace
containers or other objects that implement Python protocols.

Because magic methods are looked up differently from normal methods [#]_, this
support has been specially implemented. This means that only specific magic
Expand Down Expand Up @@ -2108,8 +2108,8 @@ There are two ``MagicMock`` variants: :class:`MagicMock` and :class:`NonCallable
.. class:: MagicMock(*args, **kw)

``MagicMock`` is a subclass of :class:`Mock` with default implementations
of most of the magic methods. You can use ``MagicMock`` without having to
configure the magic methods yourself.
of most of the :term:`magic methods <magic method>`. You can use
``MagicMock`` without having to configure the magic methods yourself.

The constructor parameters have the same meaning as for :class:`Mock`.

Expand Down
5 changes: 5 additions & 0 deletions Doc/library/zipfile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ The module defines the following items:
of the last modification to the file; the fields are described in section
:ref:`zipinfo-objects`.

.. versionadded:: 3.13
A public ``.compress_level`` attribute has been added to expose the
formerly protected ``._compresslevel``. The older protected name
continues to work as a property for backwards compatibility.

.. function:: is_zipfile(filename)

Returns ``True`` if *filename* is a valid ZIP file based on its magic number,
Expand Down
29 changes: 29 additions & 0 deletions Doc/license.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1066,3 +1066,32 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


asyncio
----------

Parts of the :mod:`asyncio` module are incorporated from
`uvloop 0.16 <https://github.com/MagicStack/uvloop/tree/v0.16.0>`_,
which is distributed under the MIT license::

Copyright (c) 2015-2021 MagicStack Inc. http://magic.io

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8 changes: 4 additions & 4 deletions Doc/reference/datamodel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1263,20 +1263,20 @@ Methods on code objects

* ``start`` (an :class:`int`) represents the offset (inclusive) of the start
of the :term:`bytecode` range
* ``end`` (an :class:`int`) represents the offset (inclusive) of the end of
* ``end`` (an :class:`int`) represents the offset (exclusive) of the end of
the :term:`bytecode` range
* ``lineno`` is an :class:`int` representing the line number of the
:term:`bytecode` range, or ``None`` if the bytecodes in the given range
have no line number

The items yielded generated will have the following properties:
The items yielded will have the following properties:

* The first range yielded will have a ``start`` of 0.
* The ``(start, end)`` ranges will be non-decreasing and consecutive. That
is, for any pair of :class:`tuple`\s, the ``start`` of the second will be
equal to the ``end`` of the first.
* No range will be backwards: ``end >= start`` for all triples.
* The :class:`tuple` yielded will have ``end`` equal to the size of the
* The last :class:`tuple` yielded will have ``end`` equal to the size of the
:term:`bytecode`.

Zero-width ranges, where ``start == end``, are allowed. Zero-width ranges
Expand Down Expand Up @@ -2308,7 +2308,7 @@ class defining the method.
this method is implicitly converted to a class method.

Keyword arguments which are given to a new class are passed to
the parent's class ``__init_subclass__``. For compatibility with
the parent class's ``__init_subclass__``. For compatibility with
other classes using ``__init_subclass__``, one should take out the
needed keyword arguments and pass the others over to the base
class, as in::
Expand Down
2 changes: 1 addition & 1 deletion Doc/tutorial/appendix.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ In interactive mode, it then returns to the primary prompt; when input came from
a file, it exits with a nonzero exit status after printing the stack trace.
(Exceptions handled by an :keyword:`except` clause in a :keyword:`try` statement
are not errors in this context.) Some errors are unconditionally fatal and
cause an exit with a nonzero exit; this applies to internal inconsistencies and
cause an exit with a nonzero exit status; this applies to internal inconsistencies and
some cases of running out of memory. All error messages are written to the
standard error stream; normal output from executed commands is written to
standard output.
Expand Down
7 changes: 7 additions & 0 deletions Doc/whatsnew/3.13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,13 @@ os
:c:func:`!posix_spawn_file_actions_addclosefrom_np`.
(Contributed by Jakub Kulik in :gh:`113117`.)

os.path
-------

* On Windows, :func:`os.path.isabs` no longer considers paths starting with
exactly one (back)slash to be absolute.
(Contributed by Barney Gale and Jon Foster in :gh:`44626`.)

pathlib
-------

Expand Down
9 changes: 8 additions & 1 deletion Include/cpython/optimizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,17 @@ typedef struct {
_PyExecutorLinkListNode links;
} _PyVMData;

typedef struct {
uint16_t opcode;
uint16_t oparg;
uint32_t target;
uint64_t operand; // A cache entry
} _PyUOpInstruction;

typedef struct _PyExecutorObject {
PyObject_VAR_HEAD
_PyVMData vm_data; /* Used by the VM, but opaque to the optimizer */
/* Data needed by the executor goes here, but is opaque to the VM */
_PyUOpInstruction trace[1];
} _PyExecutorObject;

typedef struct _PyOptimizerObject _PyOptimizerObject;
Expand Down
24 changes: 14 additions & 10 deletions Include/internal/pycore_opcode_metadata.h

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

2 changes: 0 additions & 2 deletions Include/internal/pycore_optimizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ extern "C" {
# error "this header requires Py_BUILD_CORE define"
#endif

#include "pycore_uops.h" // _PyUOpInstruction

int _Py_uop_analyze_and_optimize(PyCodeObject *code,
_PyUOpInstruction *trace, int trace_len, int curr_stackentries);

Expand Down
2 changes: 1 addition & 1 deletion Include/internal/pycore_pymem.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ extern int _PyMem_SetDefaultAllocator(
- PYMEM_FORBIDDENBYTE: untouchable bytes at each end of a block
Byte patterns 0xCB, 0xDB and 0xFB have been replaced with 0xCD, 0xDD and
0xFD to use the same values than Windows CRT debug malloc() and free().
0xFD to use the same values as Windows CRT debug malloc() and free().
If modified, _PyMem_IsPtrFreed() should be updated as well. */
#define PYMEM_CLEANBYTE 0xCD
#define PYMEM_DEADBYTE 0xDD
Expand Down
Loading

0 comments on commit f57420d

Please sign in to comment.