8000 Merge in main branch · python/cpython@db5d49b · GitHub
[go: up one dir, main page]

Skip to content

Commit db5d49b

Browse files
committed
Merge in main branch
2 parents 1701688 + 81387fe commit db5d49b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+594
-376
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ Objects/frameobject.c @markshannon
2525
Objects/call.c @markshannon
2626
Python/ceval.c @markshannon
2727
Python/compile.c @markshannon @iritkatriel
28+
Python/assemble.c @markshannon @iritkatriel
29+
Python/flowgraph.c @markshannon @iritkatriel
2830
Python/ast_opt.c @isidentical
2931
Lib/test/test_patma.py @brandtbucher
3032
Lib/test/test_peepholer.py @brandtbucher

.github/workflows/doc.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,26 @@ jobs:
7979
# Build docs with the '-n' (nit-picky) option, convert warnings to errors (-W)
8080
make -C Doc/ PYTHON=../python SPHINXOPTS="-q -n -W --keep-going" html 2>&1
8181
82+
# This build doesn't use problem matchers or check annotations
83+
# It also does not run 'make check', as sphinx-lint is not installed into the
84+
# environment.
85+
build_doc_oldest_supported_sphinx:
86+
name: 'Docs (Oldest Sphinx)'
87+
runs-on: ubuntu-latest
88+
timeout-minutes: 60
89+
steps:
90+
- uses: actions/checkout@v3
91+
- name: 'Set up Python'
92+
uses: actions/setup-python@v4
93+
with:
94+
python-version: '3.11' # known to work with Sphinx 3.2
95+
cache: 'pip'
96+
cache-dependency-path: 'Doc/requirements-oldest-sphinx.txt'
97+
- name: 'Install build dependencies'
98+
run: make -C Doc/ venv REQUIREMENTS="requirements-oldest-sphinx.txt"
99+
- name: 'Build HTML documentation'
100+
run: make -C Doc/ SPHINXOPTS="-q" SPHINXERRORHANDLING="-W --keep-going" html
101+
82102
# Run "doctest" on HEAD as new syntax doesn't exist in the latest stable release
83103
doctest:
84104
name: 'Doctest'

Doc/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ JOBS = auto
1313
PAPER =
1414
SOURCES =
1515
DISTVERSION = $(shell $(PYTHON) tools/extensions/patchlevel.py)
16+
REQUIREMENTS = requirements.txt
1617
SPHINXERRORHANDLING = -W
1718

1819
# Internal variables.
@@ -154,8 +155,8 @@ venv:
154155
echo "To recreate it, remove it first with \`make clean-venv'."; \
155156
else \
156157
$(PYTHON) -m venv $(VENVDIR); \
157-
$(VENVDIR)/bin/python3 -m pip install -U pip setuptools; \
158-
$(VENVDIR)/bin/python3 -m pip install -r requirements.txt; \
158+
$(VENVDIR)/bin/python3 -m pip install --upgrade pip; \
159+
$(VENVDIR)/bin/python3 -m pip install -r $(REQUIREMENTS); \
159160
echo "The venv has been created in the $(VENVDIR) directory"; \
160161
fi
161162

Doc/c-api/typeobj.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1145,7 +1145,7 @@ and :c:type:`PyType_Type` effectively act as defaults.)
11451145

11461146
.. data:: Py_TPFLAGS_MANAGED_DICT
11471147

1148-
This bit indicates that instances of the class have a ``__dict___``
1148+
This bit indicates that instances of the class have a ``__dict__``
11491149
attribute, and that the space for the dictionary is managed by the VM.
11501150

11511151
If this flag is set, :const:`Py_TPFLAGS_HAVE_GC` should also be set.

Doc/library/__main__.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ This is where using the ``if __name__ == '__main__'`` code block comes in
124124
handy. Code within this block won't run unless the module is executed in the
125125
top-level environment.
126126

127-
Putting as few statements as possible in the block below ``if __name___ ==
127+
Putting as few statements as possible in the block below ``if __name__ ==
128128
'__main__'`` can improve code clarity and correctness. Most often, a function
129129
named ``main`` encapsulates the program's primary behavior::
130130

Doc/library/asyncio-subprocess.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,9 @@ their completion.
207207
Interact with process:
208208

209209
1. send data to *stdin* (if *input* is not ``None``);
210-
2. read data from *stdout* and *stderr*, until EOF is reached;
211-
3. wait for process to terminate.
210+
2. closes *stdin*;
211+
3. read data from *stdout* and *stderr*, until EOF is reached;
212+
4. wait for process to terminate.
212213

213214
The optional *input* argument is the data (:class:`bytes` object)
214215
that will be sent to the child process.
@@ -229,6 +230,10 @@ their completion.
229230
Note, that the data read is buffered in memory, so do not use
230231
this method if the data size is large or unlimited.
231232

233+
.. versionchanged:: 3.12
234+
235+
*stdin* gets closed when `input=None` too.
236+
232237
.. method:: send_signal(signal)
233238

234239
Sends the signal *signal* to the child process.

Doc/library/datetime.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -896,6 +896,10 @@ Other constructors, all class methods:
896896
in UTC. As such, the recommended way to create an object representing the
897897
current time in UTC is by calling ``datetime.now(timezone.utc)``.
898898

899+
.. deprecated:: 3.12
900+
901+
Use :meth:`datetime.now` with :attr:`UTC` instead.
902+
899903

900904
.. classmethod:: datetime.fromtimestamp(timestamp, tz=None)
901905

@@ -964,6 +968,10 @@ Other constructors, all class methods:
964968
:c:func:`gmtime` function. Raise :exc:`OSError` instead of
965969
:exc:`ValueError` on :c:func:`gmtime` failure.
966970

971+
.. deprecated:: 3.12
972+
973+
Use :meth:`datetime.fromtimestamp` with :attr:`UTC` instead.
974+
967975

968976
.. classmethod:: datetime.fromordinal(ordinal)
969977

Doc/library/sqlite3.rst

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ Module functions
310310
to avoid data corruption.
311311
See :attr:`threadsafety` for more information.
312312

313-
:param Connection factory:
313+
:param ~sqlite3.Connection factory:
314314
A custom subclass of :class:`Connection` to create the connection with,
315315
if not the default :class:`Connection` class.
316316

@@ -337,7 +337,7 @@ Module functions
337337
The default will change to ``False`` in a future Python release.
338338
:type autocommit: bool
339339

340-
:rtype: Connection
340+
:rtype: ~sqlite3.Connection
341341

342342
.. audit-event:: sqlite3.connect database sqlite3.connect
343343
.. audit-event:: sqlite3.connect/handle connection_handle sqlite3.connect
@@ -1129,7 +1129,7 @@ Connection objects
11291129
Works even if the database is being accessed by other clients
11301130
or concurrently by the same connection.
11311131

1132-
:param Connection target:
1132+
:param ~sqlite3.Connection target:
11331133
The database connection to save the backup to.
11341134

11351135
:param int pages:
@@ -1530,12 +1530,12 @@ Cursor objects
15301530

15311531
For every item in *parameters*,
15321532
repeatedly execute the :ref:`parameterized <sqlite3-placeholders>`
1533-
SQL statement *sql*.
1533+
:abbr:`DML (Data Manipulation Language)` SQL statement *sql*.
15341534

15351535
Uses the same implicit transaction handling as :meth:`~Cursor.execute`.
15361536

15371537
:param str sql:
1538-
A single SQL :abbr:`DML (Data Manipulation Language)` statement.
1538+
A single SQL DML statement.
15391539

15401540
:param parameters:
15411541
An :term:`!iterable` of parameters to bind with
@@ -1558,6 +1558,13 @@ Cursor objects
15581558
# cur is an sqlite3.Cursor object
15591559
cur.executemany("INSERT INTO data VALUES(?)", rows)
15601560

1561+
.. note::
1562+
1563+
Any resulting rows are discarded,
1564+
including DML statements with `RETURNING clauses`_.
1565+
1566+
.. _RETURNING clauses: https://www.sqlite.org/lang_returning.html
1567+
15611568
.. deprecated-removed:: 3.12 3.14
15621569

15631570
:exc:`DeprecationWarning` is emitted if

Doc/requirements-oldest-sphinx.txt

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Requirements to build the Python documentation, for the oldest supported
2+
# Sphinx version.
3+
#
4+
# We pin Sphinx and all of its dependencies to ensure a consistent environment.
5+
6+
blurb
7+
python-docs-theme>=2022.1
8+
9+
# Generated from:
10+
# pip install "Sphinx~=3.2.0" "docutils<0.17" "Jinja2<3" "MarkupSafe<2"
11+
# pip freeze
12+
#
13+
# Sphinx 3.2 comes from ``needs_sphinx = '3.2'`` in ``Doc/conf.py``.
14+
# Docutils<0.17, Jinja2<3, and MarkupSafe<2 are additionally specified as
15+
# Sphinx 3.2 is incompatible with newer releases of these packages.
16+
17+
Sphinx==3.2.1
18+
alabaster==0.7.13
19+
Babel==2.12.1
20+
certifi==2022.12.7
21+
charset-normalizer==3.1.0
22+
colorama==0.4.6
23+
docutils==0.16
24+
idna==3.4
25+
imagesize==1.4.1
26+
Jinja2==2.11.3
27+
MarkupSafe==1.1.1
28+
packaging==23.1
29+
Pygments==2.15.1
30+
requests==2.29.0
31+
snowballstemmer==2.2.0
32+
sphinxcontrib-applehelp==1.0.4
33+
sphinxcontrib-devhelp==1.0.2
34+
sphinxcontrib-htmlhelp==2.0.1
35+
sphinxcontrib-jsmath==1.0.1
36+
sphinxcontrib-qthelp==1.0.3
37+
sphinxcontrib-serializinghtml==1.1.5
38+
urllib3==1.26.15

Include/internal/pycore_bytesobject.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@ extern "C" {
99
#endif
1010

1111

12-
/* runtime lifecycle */
13-
14-
extern PyStatus _PyBytes_InitTypes(PyInterpreterState *);
15-
16-
1712
/* Substring Search.
1813
1914
Returns the index of the first occurrence of

0 commit comments

Comments
 (0)
0