8000 Merge branch 'main' into sqlite-serialize · erlend-aasland/cpython@d6934f9 · GitHub
[go: up one dir, main page]

Skip to content

Commit d6934f9

Browse files
author
Erlend E. Aasland
committed
Merge branch 'main' into sqlite-serialize
Sync with main bco. pythonGH-27273
2 parents 1bdb611 + 6b61d74 commit d6934f9

File tree

252 files changed

+5645
-3753
lines changed

Some content is hidden

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

252 files changed

+5645
-3753
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
# Check for changes in regenerated files
7676
if ! test -z "$changes"
7777
then
78-
echo "Generated files not up to date. Perhaps you forgot to run make regen-all ;)"
78+
echo "Generated files not up to date. Perhaps you forgot to run make regen-all or build.bat --regen ;)"
7979
echo "$changes"
8080
exit 1
8181
fi

Doc/Makefile

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ help:
4545
@echo " check to run a check for frequent markup errors"
4646
@echo " serve to serve the documentation on the localhost (8000)"
4747

48-
build:
48+
build: venv
4949
-mkdir -p build
5050
# Look first for a Misc/NEWS file (building from a source release tarball
5151
# or old repo) and use that, otherwise look for a Misc/NEWS.d directory
@@ -137,14 +137,21 @@ pydoc-topics: build
137137
htmlview: html
138138
$(PYTHON) -c "import webbrowser; webbrowser.open('build/html/index.html')"
139139

140-
clean:
141-
-rm -rf build/* $(VENVDIR)/*
140+
clean: clean-venv
141+
-rm -rf build/*
142+
143+
clean-venv:
144+
rm -rf $(VENVDIR)
142145

143146
venv:
144-
$(PYTHON) -m venv $(VENVDIR)
145-
$(VENVDIR)/bin/python3 -m pip install -U pip setuptools
146-
$(VENVDIR)/bin/python3 -m pip install -r requirements.txt
147-
@echo "The venv has been created in the $(VENVDIR) directory"
147+
@if [ -d $(VENVDIR) ] ; then \
148+
echo "venv already exists"; \
149+
else \
150+
$(PYTHON) -m venv $(VENVDIR); \
151+
$(VENVDIR)/bin/python3 -m pip install -U pip setuptools; \
152+
$(VENVDIR)/bin/python3 -m pip install -r requirements.txt; \
153+
echo "The venv has been created in the $(VENVDIR) directory"; \
154+
fi
148155

149156
dist:
150157
rm -rf dist

Doc/README.rst

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,28 +28,24 @@ install the tools into there.
2828
Using make
2929
----------
3030

31-
To get started on UNIX, you can create a virtual environment with the command ::
32-
33-
make venv
34-
35-
That will install all the tools necessary to build the documentation. Assuming
36-
the virtual environment was created in the ``venv`` directory (the default;
37-
configurable with the VENVDIR variable), you can run the following command to
38-
build the HTML output files::
31+
To get started on UNIX, you can create a virtual environment and build
32+
documentation with the command::
3933

4034
make html
4135

42-
By default, if the virtual environment is not created, the Makefile will
43-
look for instances of sphinxbuild and blurb installed on your process PATH
44-
(configurable with the SPHINXBUILD and BLURB variables).
36+
The virtual environment in the ``venv`` directory will contain all the tools
37+
necessary to build the documentation. You can also configure where the virtual
38+
environment directory will be with the ``VENVDIR`` variable.
4539

4640
On Windows, we try to emulate the Makefile as closely as possible with a
4741
``make.bat`` file. If you need to specify the Python interpreter to use,
48-
set the PYTHON environment variable instead.
42+
set the PYTHON environment variable.
4943

5044
Available make targets are:
5145

52-
* "clean", which removes all build files.
46+
* "clean", which removes all build files and the virtual environment.
47+
48+
* "clean-venv", which removes the virtual environment directory.
5349

5450
* "venv", which creates a virtual environment with all necessary tools
5551
installed.

Doc/bugs.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Using the Python issue tracker
4141
==============================
4242

4343
Bug reports for Python itself should be submitted via the Python Bug Tracker
44-
(https://bugs.python.org/). The bug tracker offers a Web form which allows
44+
(https://bugs.python.org/). The bug tracker offers a web form which allows
4545
pertinent information to be entered and submitted to the developers.
4646

4747
The first step in filing a report is to determine whether the problem has

Doc/c-api/abstract.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ but whose items have not been set to some non-\ ``NULL`` value yet.
2424
mapping.rst
2525
iter.rst
2626
buffer.rst
27+
objbuffer.rst

Doc/c-api/objbuffer.rst

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
.. highlight:: c
2+
3+
Old Buffer Protocol
4+
-------------------
5+
6+
.. deprecated:: 3.0
7+
8+
These functions were part of the "old buffer protocol" API in Python 2.
9+
In Python 3, this protocol doesn't exist anymore but the functions are still
10+
exposed to ease porting 2.x code. They act as a compatibility wrapper
11+
around the :ref:`new buffer protocol <bufferobjects>`, but they don't give
12+
you control over the lifetime of the resources acquired when a buffer is
13+
exported.
14+
15+
Therefore, it is recommended that you call :c:func:`PyObject_GetBuffer`
16+
(or the ``y*`` or ``w*`` :ref:`format codes <arg-parsing>` with the
17+
:c:func:`PyArg_ParseTuple` family of functions) to get a buffer view over
18+
an object, and :c:func:`PyBuffer_Release` when the buffer view can be released.
19+
20+
21+
.. c:function:: int PyObject_AsCharBuffer(PyObject *obj, const char **buffer, Py_ssize_t *buffer_len)
22+
23+
Returns a pointer to a read-only memory location usable as character-based
24+
input. The *obj* argument must support the single-segment character buffer
25+
interface. On success, returns ``0``, sets *buffer* to the memory location
26+
and *buffer_len* to the buffer length. Returns ``-1`` and sets a
27+
:exc:`TypeError` on error.
28+
29+
30+
.. c:function:: int PyObject_AsReadBuffer(PyObject *obj, const void **buffer, Py_ssize_t *buffer_len)
31+
32+
Returns a pointer to a read-only memory location containing arbitrary data.
33+
The *obj* argument must support the single-segment readable buffer
34+
interface. On success, returns ``0``, sets *buffer* to the memory location
35+
and *buffer_len* to the buffer length. Returns ``-1`` and sets a
36+
:exc:`TypeError` on error.
37+
38+
39+
.. c:function:: int PyObject_CheckReadBuffer(PyObject *o)
40+
41+
Returns ``1`` if *o* supports the single-segment readable buffer interface.
42+
Otherwise returns ``0``. This function always succeeds.
43+
44+
Note that this function tries to get and release a buffer, and exceptions
45+
which occur while calling corresponding functions will get suppressed.
46+
To get error reporting use :c:func:`PyObject_GetBuffer()` instead.
47+
48+
49+
.. c:function:: int PyObject_AsWriteBuffer(PyObject *obj, void **buffer, Py_ssize_t *buffer_len)
50+
51+
Returns a pointer to a writable memory location. The *obj* argument must
52+
support the single-segment, character buffer interface. On success,
53+
returns ``0``, sets *buffer* to the memory location and *buffer_len* to the
54+
buffer length. Returns ``-1`` and sets a :exc:`TypeError` on error.
55+

Doc/c-api/type.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@ Type Objects
106106
GC protocol itself by at least implementing the
107107
:c:member:`~PyTypeObject.tp_traverse` handle.
108108
109+
.. c:function:: PyObject* PyType_GetName(PyTypeObject *type)
110+
111+
Return the type's name. Equivalent to getting the type's ``__name__`` attribute.
112+
113+
.. versionadded:: 3.11
114+
109115
.. c:function:: void* PyType_GetSlot(PyTypeObject *type, int slot)
110116
111117
Return the function pointer stored in the given slot. If the

Doc/c-api/typeobj.rst

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,8 +1098,7 @@ and :c:type:`PyType_Type` effectively act as defaults.)
10981098

10991099
This is a bitmask of all the bits that pertain to the existence of certain
11001100
fields in the type object and its extension structures. Currently, it includes
1101-
the following bits: :const:`Py_TPFLAGS_HAVE_STACKLESS_EXTENSION`,
1102-
:const:`Py_TPFLAGS_HAVE_VERSION_TAG`.
1101+
the following bits: :const:`Py_TPFLAGS_HAVE_STACKLESS_EXTENSION`.
11031102

11041103
**Inheritance:**
11051104

@@ -1179,14 +1178,6 @@ and :c:type:`PyType_Type` effectively act as defaults.)
11791178

11801179
.. versionadded:: 3.9
11811180

1182-
1183-
.. data:: Py_TPFLAGS_HAVE_AM_SEND
1184-
1185-
This bit is set when the :c:member:`~PyAsyncMethods.am_send` entry is present in the
1186-
:c:member:`~PyTypeObject.tp_as_async` slot of type structure.
1187-
1188-
.. versionadded:: 3.10
1189-
11901181
.. data:: Py_TPFLAGS_IMMUTABLETYPE
11911182

11921183
This bit is set for type objects that are immutable: type attributes cannot be set nor deleted.

Doc/c-api/unicode.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ access internal read-only data of Unicode objects:
149149
``PyUnicode_WCHAR_KIND`` is deprecated.
150150
151151
152-
.. c:function:: int PyUnicode_KIND(PyObject *o)
152+
.. c:function:: unsigned int PyUnicode_KIND(PyObject *o)
153153
154154
Return one of the PyUnicode kind constants (see above) that indicate how many
155155
bytes per character this Unicode object uses to store its data. *o* has to

Doc/data/refcounts.dat

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,6 +1571,21 @@ PyOS_FSPath:PyObject*:path:0:
15711571
PyObject_ASCII:PyObject*::+1:
15721572
PyObject_ASCII:PyObject*:o:0:
15731573

1574+
PyObject_AsCharBuffer:int:::
1575+
PyObject_AsCharBuffer:PyObject*:obj:0:
1576+
PyObject_AsCharBuffer:const char**:buffer::
1577+
PyObject_AsCharBuffer:Py_ssize_t*:buffer_len::
1578+
1579+
PyObject_AsReadBuffer:int:::
1580+
PyObject_AsReadBuffer:PyObject*:obj:0:
1581+
PyObject_AsReadBuffer:const void**:buffer::
1582+
PyObject_AsReadBuffer:Py_ssize_t*:buffer_len::
1583+
1584+
PyObject_AsWriteBuffer:int:::
1585+
PyObject_AsWriteBuffer:PyObject*:obj:0:
1586+
PyObject_AsWriteBuffer:void**:buffer::
1587+
PyObject_AsWriteBuffer:Py_ssize_t*:buffer_len::
1588+
15741589
PyObject_Bytes:PyObject*::+1:
15751590
PyObject_Bytes:PyObject*:o:0:
15761591

@@ -1606,6 +1621,9 @@ PyObject_CallObject:PyObject*:args:0:
16061621
PyObject_CheckBuffer:int:::
16071622
PyObject_CheckBuffer:PyObject*:obj:0:
16081623

1624+
PyObject_CheckReadBuffer:int:::
1625+
PyObject_CheckReadBuffer:PyObject*:o:0:
1626+
16091627
PyObject_DelAttr:int:::
16101628
PyObject_DelAttr:PyObject*:o:0:
16111629
PyObject_DelAttr:PyObject*:attr_name:0:
@@ -2289,6 +2307,9 @@ PyType_GenericNew:PyObject*:kwds:0:
22892307
PyType_GetFlags:unsigned long:::
22902308
PyType_GetFlags:PyTypeObject*:type:0:
22912309

2310+
PyType_GetName:PyObject*::+1:
2311+
PyType_GetName:PyTypeObject*:type:0:
2312+
22922313
PyType_GetSlot:void*:::
22932314
PyType_GetSlot:PyTypeObject*:type:0:
22942315
PyType_GetSlot:int:slot::

0 commit comments

Comments
 (0)
0