Skip to content

Commit

Permalink
Merge branch 'main' into os-path-isreserved
Browse files Browse the repository at this point in the history
  • Loading branch information
barneygale committed Jan 14, 2024
2 parents f9033b3 + ca6cf56 commit efb7681
Show file tree
Hide file tree
Showing 272 changed files with 4,202 additions and 2,141 deletions.
29 changes: 0 additions & 29 deletions .cirrus-DISABLED.yml

This file was deleted.

8 changes: 8 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ jobs:
run: echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
- name: Configure ccache action
uses: hendrikmuhs/[email protected]
with:
save: false
- name: Check Autoconf and aclocal versions
run: |
grep "Generated by GNU Autoconf 2.71" configure
Expand Down Expand Up @@ -284,6 +286,8 @@ jobs:
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
- name: Configure ccache action
uses: hendrikmuhs/[email protected]
with:
save: false
- name: Configure CPython
run: ./configure --config-cache --with-pydebug --with-openssl=$OPENSSL_DIR
- name: Build CPython
Expand Down Expand Up @@ -327,6 +331,8 @@ jobs:
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
- name: Configure ccache action
uses: hendrikmuhs/[email protected]
with:
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 Expand Up @@ -446,6 +452,8 @@ jobs:
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
- name: Configure ccache action
uses: hendrikmuhs/[email protected]
with:
save: ${{ github.event_name == 'push' }}
- name: Configure CPython
run: ./configure --config-cache --with-address-sanitizer --without-pymalloc
- name: Build CPython
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/reusable-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ jobs:
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
- name: Configure ccache action
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
2 changes: 1 addition & 1 deletion Doc/faq/design.rst
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ on the key and a per-process seed; for example, ``'Python'`` could hash to
to ``1142331976``. The hash code is then used to calculate a location in an
internal array where the value will be stored. Assuming that you're storing
keys that all have different hash values, this means that dictionaries take
constant time -- O(1), in Big-O notation -- to retrieve a key.
constant time -- *O*\ (1), in Big-O notation -- to retrieve a key.


Why must dictionary keys be immutable?
Expand Down
2 changes: 1 addition & 1 deletion Doc/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ Glossary
list
A built-in Python :term:`sequence`. Despite its name it is more akin
to an array in other languages than to a linked list since access to
elements is O(1).
elements is *O*\ (1).

list comprehension
A compact way to process all or part of the elements in a sequence and
Expand Down
2 changes: 1 addition & 1 deletion Doc/howto/descriptor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,7 @@ instance::
<function D.f at 0x00C45070>

>>> d.f.__self__
<__main__.D object at 0x1012e1f98>
<__main__.D object at 0x00B18C90>

If you have ever wondered where *self* comes from in regular methods or where
*cls* comes from in class methods, this is it!
Expand Down
18 changes: 9 additions & 9 deletions Doc/howto/urllib2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -392,16 +392,16 @@ info and geturl
===============

The response returned by urlopen (or the :exc:`~urllib.error.HTTPError` instance) has two
useful methods :meth:`info` and :meth:`geturl` and is defined in the module
:mod:`urllib.response`..
useful methods :meth:`!info` and :meth:`!geturl` and is defined in the module
:mod:`urllib.response`.

**geturl** - this returns the real URL of the page fetched. This is useful
because ``urlopen`` (or the opener object used) may have followed a
redirect. The URL of the page fetched may not be the same as the URL requested.
* **geturl** - this returns the real URL of the page fetched. This is useful
because ``urlopen`` (or the opener object used) may have followed a
redirect. The URL of the page fetched may not be the same as the URL requested.

**info** - this returns a dictionary-like object that describes the page
fetched, particularly the headers sent by the server. It is currently an
:class:`http.client.HTTPMessage` instance.
* **info** - this returns a dictionary-like object that describes the page
fetched, particularly the headers sent by the server. It is currently an
:class:`http.client.HTTPMessage` instance.

Typical headers include 'Content-length', 'Content-type', and so on. See the
`Quick Reference to HTTP Headers <https://jkorpela.fi/http.html>`_
Expand Down Expand Up @@ -507,7 +507,7 @@ than the URL you pass to .add_password() will also match. ::

In the above example we only supplied our ``HTTPBasicAuthHandler`` to
``build_opener``. By default openers have the handlers for normal situations
-- ``ProxyHandler`` (if a proxy setting such as an :envvar:`http_proxy`
-- ``ProxyHandler`` (if a proxy setting such as an :envvar:`!http_proxy`
environment variable is set), ``UnknownHandler``, ``HTTPHandler``,
``HTTPDefaultErrorHandler``, ``HTTPRedirectHandler``, ``FTPHandler``,
``FileHandler``, ``DataHandler``, ``HTTPErrorProcessor``.
Expand Down
8 changes: 4 additions & 4 deletions Doc/library/asyncio-policy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ implementation used by the asyncio event loop:

It works reliably even when the asyncio event loop is run in a non-main OS thread.

There is no noticeable overhead when handling a big number of children (*O(1)* each
There is no noticeable overhead when handling a big number of children (*O*\ (1) each
time a child terminates), but starting a thread per process requires extra memory.

This watcher is used by default.
Expand All @@ -257,7 +257,7 @@ implementation used by the asyncio event loop:
watcher is installed.

The solution is safe but it has a significant overhead when
handling a big number of processes (*O(n)* each time a
handling a big number of processes (*O*\ (*n*) each time a
:py:data:`SIGCHLD` is received).

.. versionadded:: 3.8
Expand All @@ -273,7 +273,7 @@ implementation used by the asyncio event loop:
The watcher avoids disrupting other code spawning processes
by polling every process explicitly on a :py:data:`SIGCHLD` signal.

This solution is as safe as :class:`MultiLoopChildWatcher` and has the same *O(N)*
This solution is as safe as :class:`MultiLoopChildWatcher` and has the same *O*\ (*n*)
complexity but requires a running event loop in the main thread to work.

.. deprecated:: 3.12
Expand All @@ -285,7 +285,7 @@ implementation used by the asyncio event loop:
processes and waiting for their termination.

There is no noticeable overhead when handling a big number of
children (*O(1)* each time a child terminates).
children (*O*\ (1) each time a child terminates).

This solution requires a running event loop in the main thread to work, as
:class:`SafeChildWatcher`.
Expand Down
6 changes: 3 additions & 3 deletions Doc/library/bisect.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ The following functions are provided:
To support inserting records in a table, the *key* function (if any) is
applied to *x* for the search step but not for the insertion step.

Keep in mind that the ``O(log n)`` search is dominated by the slow O(n)
Keep in mind that the *O*\ (log *n*) search is dominated by the slow *O*\ (*n*)
insertion step.

.. versionchanged:: 3.10
Expand All @@ -99,7 +99,7 @@ The following functions are provided:
To support inserting records in a table, the *key* function (if any) is
applied to *x* for the search step but not for the insertion step.

Keep in mind that the ``O(log n)`` search is dominated by the slow O(n)
Keep in mind that the *O*\ (log *n*) search is dominated by the slow *O*\ (*n*)
insertion step.

.. versionchanged:: 3.10
Expand All @@ -115,7 +115,7 @@ thoughts in mind:
* Bisection is effective for searching ranges of values.
For locating specific values, dictionaries are more performant.

* The *insort()* functions are ``O(n)`` because the logarithmic search step
* The *insort()* functions are *O*\ (*n*) because the logarithmic search step
is dominated by the linear time insertion step.

* The search functions are stateless and discard key function results after
Expand Down
6 changes: 3 additions & 3 deletions Doc/library/collections.rst
Original file line number Diff line number Diff line change
Expand Up @@ -458,10 +458,10 @@ or subtracting from an empty counter.
Deques are a generalization of stacks and queues (the name is pronounced "deck"
and is short for "double-ended queue"). Deques support thread-safe, memory
efficient appends and pops from either side of the deque with approximately the
same O(1) performance in either direction.
same *O*\ (1) performance in either direction.

Though :class:`list` objects support similar operations, they are optimized for
fast fixed-length operations and incur O(n) memory movement costs for
fast fixed-length operations and incur *O*\ (*n*) memory movement costs for
``pop(0)`` and ``insert(0, v)`` operations which change both the size and
position of the underlying data representation.

Expand Down Expand Up @@ -585,7 +585,7 @@ or subtracting from an empty counter.
In addition to the above, deques support iteration, pickling, ``len(d)``,
``reversed(d)``, ``copy.copy(d)``, ``copy.deepcopy(d)``, membership testing with
the :keyword:`in` operator, and subscript references such as ``d[0]`` to access
the first element. Indexed access is O(1) at both ends but slows to O(n) in
the first element. Indexed access is *O*\ (1) at both ends but slows to *O*\ (*n*) in
the middle. For fast random access, use lists instead.

Starting in version 3.5, deques support ``__add__()``, ``__mul__()``,
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/contextvars.rst
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Manual Context Management
ctx: Context = copy_context()
print(list(ctx.items()))

The function has an O(1) complexity, i.e. works equally fast for
The function has an *O*\ (1) complexity, i.e. works equally fast for
contexts with a few context variables and for contexts that have
a lot of them.

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/heapq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ winner. The simplest algorithmic way to remove it and find the "next" winner is
to move some loser (let's say cell 30 in the diagram above) into the 0 position,
and then percolate this new 0 down the tree, exchanging values, until the
invariant is re-established. This is clearly logarithmic on the total number of
items in the tree. By iterating over all items, you get an O(n log n) sort.
items in the tree. By iterating over all items, you get an *O*\ (*n* log *n*) sort.

A nice feature of this sort is that you can efficiently insert new items while
the sort is going on, provided that the inserted items are not "better" than the
Expand Down
10 changes: 6 additions & 4 deletions Doc/library/http.client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ The module provides the following classes:
.. versionchanged:: 3.4.3
This class now performs all the necessary certificate and hostname checks
by default. To revert to the previous, unverified, behavior
:func:`ssl._create_unverified_context` can be passed to the *context*
:func:`!ssl._create_unverified_context` can be passed to the *context*
parameter.

.. versionchanged:: 3.8
Expand All @@ -103,7 +103,7 @@ The module provides the following classes:
.. versionchanged:: 3.10
This class now sends an ALPN extension with protocol indicator
``http/1.1`` when no *context* is given. Custom *context* should set
ALPN protocols with :meth:`~ssl.SSLContext.set_alpn_protocol`.
ALPN protocols with :meth:`~ssl.SSLContext.set_alpn_protocols`.

.. versionchanged:: 3.12
The deprecated *key_file*, *cert_file* and *check_hostname* parameters
Expand All @@ -124,7 +124,7 @@ This module provides the following function:
.. function:: parse_headers(fp)

Parse the headers from a file pointer *fp* representing a HTTP
request/response. The file has to be a :class:`BufferedIOBase` reader
request/response. The file has to be a :class:`~io.BufferedIOBase` reader
(i.e. not text) and must provide a valid :rfc:`2822` style header.

This function returns an instance of :class:`http.client.HTTPMessage`
Expand Down Expand Up @@ -416,7 +416,7 @@ HTTPConnection Objects
.. versionadded:: 3.7


As an alternative to using the :meth:`request` method described above, you can
As an alternative to using the :meth:`~HTTPConnection.request` method described above, you can
also send your request step by step, by using the four functions below.


Expand Down Expand Up @@ -648,6 +648,8 @@ method attribute. Here is an example session that uses the ``PUT`` method::
HTTPMessage Objects
-------------------

.. class:: HTTPMessage(email.message.Message)

An :class:`http.client.HTTPMessage` instance holds the headers from an HTTP
response. It is implemented using the :class:`email.message.Message` class.

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.
34 changes: 26 additions & 8 deletions Doc/library/mmap.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ To map anonymous memory, -1 should be passed as the fileno along with the length
the same file. If you specify the name of an existing tag, that tag is
opened, otherwise a new tag of this name is created. If this parameter is
omitted or ``None``, the mapping is created without a name. Avoiding the
use of the tag parameter will assist in keeping your code portable between
Unix and Windows.
use of the *tagname* parameter will assist in keeping your code portable
between Unix and Windows.

*offset* may be specified as a non-negative integer offset. mmap references
will be relative to the offset from the beginning of the file. *offset*
Expand Down 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/msvcrt.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,14 @@ File Operations
.. function:: open_osfhandle(handle, flags)

Create a C runtime file descriptor from the file handle *handle*. The *flags*
parameter should be a bitwise OR of :const:`os.O_APPEND`, :const:`os.O_RDONLY`,
and :const:`os.O_TEXT`. The returned file descriptor may be used as a parameter
parameter should be a bitwise OR of :const:`os.O_APPEND`,
:const:`os.O_RDONLY`, :const:`os.O_TEXT` and :const:`os.O_NOINHERIT`.
The returned file descriptor may be used as a parameter
to :func:`os.fdopen` to create a file object.

The file descriptor is inheritable by default. Pass :const:`os.O_NOINHERIT`
flag to make it non inheritable.

.. audit-event:: msvcrt.open_osfhandle handle,flags msvcrt.open_osfhandle


Expand Down
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
Loading

0 comments on commit efb7681

Please sign in to comment.