Skip to content

Commit 9901102

Browse files
author
Jeremy Hylton
committed
Merge branch 'main' of github.com:jeremyhylton/cpython
2 parents 9ad8760 + 0bd32c7 commit 9901102

Some content is hidden

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

62 files changed

+2212
-1039
lines changed

Doc/Makefile

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -188,54 +188,69 @@ dist:
188188
mkdir -p dist
189189

190190
# archive the HTML
191-
make html
191+
@echo "Building HTML..."
192+
$(MAKE) html
192193
cp -pPR build/html dist/python-$(DISTVERSION)-docs-html
193194
tar -C dist -cf dist/python-$(DISTVERSION)-docs-html.tar python-$(DISTVERSION)-docs-html
194195
bzip2 -9 -k dist/python-$(DISTVERSION)-docs-html.tar
195196
(cd dist; zip -q -r -9 python-$(DISTVERSION)-docs-html.zip python-$(DISTVERSION)-docs-html)
196197
rm -r dist/python-$(DISTVERSION)-docs-html
197198
rm dist/python-$(DISTVERSION)-docs-html.tar
199+
@echo "Build finished and archived!"
198200

199201
# archive the text build
200-
make text
202+
@echo "Building text..."
203+
$(MAKE) text
201204
cp -pPR build/text dist/python-$(DISTVERSION)-docs-text
202205
tar -C dist -cf dist/python-$(DISTVERSION)-docs-text.tar python-$(DISTVERSION)-docs-text
203206
bzip2 -9 -k dist/python-$(DISTVERSION)-docs-text.tar
204207
(cd dist; zip -q -r -9 python-$(DISTVERSION)-docs-text.zip python-$(DISTVERSION)-docs-text)
205208
rm -r dist/python-$(DISTVERSION)-docs-text
206209
rm dist/python-$(DISTVERSION)-docs-text.tar
210+
@echo "Build finished and archived!"
207211

208212
# archive the A4 latex
213+
@echo "Building LaTeX (A4 paper)..."
209214
rm -rf build/latex
210-
make latex PAPER=a4
211-
-sed -i 's/makeindex/makeindex -q/' build/latex/Makefile
212-
(cd build/latex; make clean && make all-pdf && make FMT=pdf zip bz2)
215+
$(MAKE) latex PAPER=a4
216+
# remove zip & bz2 dependency on all-pdf,
217+
# as otherwise the full latexmk process is run twice.
218+
# ($$ is needed to escape the $; https://www.gnu.org/software/make/manual/make.html#Basics-of-Variable-References)
219+
-sed -i 's/: all-$$(FMT)/:/' build/latex/Makefile
220+
(cd build/latex; $(MAKE) clean && $(MAKE) --jobs=$((`nproc`+1)) --output-sync LATEXMKOPTS='-quiet' all-pdf && $(MAKE) FMT=pdf zip bz2)
213221
cp build/latex/docs-pdf.zip dist/python-$(DISTVERSION)-docs-pdf-a4.zip
214222
cp build/latex/docs-pdf.tar.bz2 dist/python-$(DISTVERSION)-docs-pdf-a4.tar.bz2
223+
@echo "Build finished and archived!"
215224

216225
# archive the letter latex
226+
@echo "Building LaTeX (US paper)..."
217227
rm -rf build/latex
218-
make latex PAPER=letter
219-
-sed -i 's/makeindex/makeindex -q/' build/latex/Makefile
220-
(cd build/latex; make clean && make all-pdf && make FMT=pdf zip bz2)
228+
$(MAKE) latex PAPER=letter
229+
-sed -i 's/: all-$$(FMT)/:/' build/latex/Makefile
230+
(cd build/latex; $(MAKE) clean && $(MAKE) --jobs=$((`nproc`+1)) --output-sync LATEXMKOPTS='-quiet' all-pdf && $(MAKE) FMT=pdf zip bz2)
221231
cp build/latex/docs-pdf.zip dist/python-$(DISTVERSION)-docs-pdf-letter.zip
222232
cp build/latex/docs-pdf.tar.bz2 dist/python-$(DISTVERSION)-docs-pdf-letter.tar.bz2
233+
@echo "Build finished and archived!"
223234

224235
# copy the epub build
236+
@echo "Building EPUB..."
225237
rm -rf build/epub
226-
make epub
238+
$(MAKE) epub
227239
cp -pPR build/epub/Python.epub dist/python-$(DISTVERSION)-docs.epub
240+
@echo "Build finished and archived!"
228241

229242
# archive the texinfo build
243+
@echo "Building Texinfo..."
230244
rm -rf build/texinfo
231-
make texinfo
232-
make info --directory=build/texinfo
245+
$(MAKE) texinfo
246+
$(MAKE) info --directory=build/texinfo
233247
cp -pPR build/texinfo dist/python-$(DISTVERSION)-docs-texinfo
234248
tar -C dist -cf dist/python-$(DISTVERSION)-docs-texinfo.tar python-$(DISTVERSION)-docs-texinfo
235249
bzip2 -9 -k dist/python-$(DISTVERSION)-docs-texinfo.tar
236250
(cd dist; zip -q -r -9 python-$(DISTVERSION)-docs-texinfo.zip python-$(DISTVERSION)-docs-texinfo)
237251
rm -r dist/python-$(DISTVERSION)-docs-texinfo
238252
rm dist/python-$(DISTVERSION)-docs-texinfo.tar
253+
@echo "Build finished and archived!"
239254

240255
.PHONY: _ensure-package
241256
_ensure-package: venv
@@ -247,11 +262,11 @@ _ensure-package: venv
247262

248263
.PHONY: _ensure-pre-commit
249264
_ensure-pre-commit:
250-
make _ensure-package PACKAGE=pre-commit
265+
$(MAKE) _ensure-package PACKAGE=pre-commit
251266

252267
.PHONY: _ensure-sphinx-autobuild
253268
_ensure-sphinx-autobuild:
254-
make _ensure-package PACKAGE=sphinx-autobuild
269+
$(MAKE) _ensure-package PACKAGE=sphinx-autobuild
255270

256271
.PHONY: check
257272
check: _ensure-pre-commit
@@ -271,12 +286,12 @@ serve:
271286
# for development releases: always build
272287
.PHONY: autobuild-dev
273288
autobuild-dev:
274-
make dist SPHINXOPTS='$(SPHINXOPTS) -Ea -A daily=1'
289+
$(MAKE) dist SPHINXOPTS='$(SPHINXOPTS) -Ea -A daily=1'
275290

276291
# for quick rebuilds (HTML only)
277292
.PHONY: autobuild-dev-html
278293
autobuild-dev-html:
279-
make html SPHINXOPTS='$(SPHINXOPTS) -Ea -A daily=1'
294+
$(MAKE) html SPHINXOPTS='$(SPHINXOPTS) -Ea -A daily=1'
280295

281296
# for stable releases: only build if not in pre-release stage (alpha, beta)
282297
# release candidate downloads are okay, since the stable tree can be in that stage
@@ -286,12 +301,12 @@ autobuild-stable:
286301
echo "Not building; $(DISTVERSION) is not a release version."; \
287302
exit 1;; \
288303
esac
289-
@make autobuild-dev
304+
@$(MAKE) autobuild-dev
290305

291306
.PHONY: autobuild-stable-html
292307
autobuild-stable-html:
293308
@case $(DISTVERSION) in *[ab]*) \
294309
echo "Not building; $(DISTVERSION) is not a release version."; \
295310
exit 1;; \
296311
esac
297-
@make autobuild-dev-html
312+
@$(MAKE) autobuild-dev-html

Doc/c-api/long.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
9494
ignored. If there are no digits or *str* is not NULL-terminated following the
9595
digits and trailing whitespace, :exc:`ValueError` will be raised.
9696
97-
.. seealso:: Python methods :meth:`int.to_bytes` and :meth:`int.from_bytes`
98-
to convert a :c:type:`PyLongObject` to/from an array of bytes in base
99-
``256``. You can call those from C using :c:func:`PyObject_CallMethod`.
97+
.. seealso:: :c:func:`PyLong_AsNativeBytes()` and
98+
:c:func:`PyLong_FromNativeBytes()` functions can be used to convert
99+
a :c:type:`PyLongObject` to/from an array of bytes in base ``256``.
100100
101101
102102
.. c:function:: PyObject* PyLong_FromUnicodeObject(PyObject *u, int base)

Doc/library/configparser.rst

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,13 +1314,19 @@ RawConfigParser Objects
13141314

13151315
.. method:: add_section(section)
13161316

1317-
Add a section named *section* to the instance. If a section by the given
1318-
name already exists, :exc:`DuplicateSectionError` is raised. If the
1319-
*default section* name is passed, :exc:`ValueError` is raised.
1317+
Add a section named *section* or :const:`UNNAMED_SECTION` to the instance.
1318+
1319+
If the given section already exists, :exc:`DuplicateSectionError` is
1320+
raised. If the *default section* name is passed, :exc:`ValueError` is
1321+
raised. If :const:`UNNAMED_SECTION` is passed and support is disabled,
1322+
:exc:`UnnamedSectionDisabledError` is raised.
13201323

13211324
Type of *section* is not checked which lets users create non-string named
13221325
sections. This behaviour is unsupported and may cause internal errors.
13231326

1327+
.. versionchanged:: 3.14
1328+
Added support for :const:`UNNAMED_SECTION`.
1329+
13241330

13251331
.. method:: set(section, option, value)
13261332

@@ -1405,7 +1411,6 @@ Exceptions
14051411
Exception raised when attempting to parse a file which has no section
14061412
headers.
14071413

1408-
14091414
.. exception:: ParsingError
14101415

14111416
Exception raised when errors occur attempting to parse a file.
@@ -1421,6 +1426,13 @@ Exceptions
14211426

14221427
.. versionadded:: 3.13
14231428

1429+
.. exception:: UnnamedSectionDisabledError
1430+
1431+
Exception raised when attempting to use the
1432+
:const:`UNNAMED_SECTION` without enabling it.
1433+
1434+
.. versionadded:: 3.14
1435+
14241436
.. rubric:: Footnotes
14251437

14261438
.. [1] Config parsers allow for heavy customization. If you are interested in

Doc/library/dis.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1555,7 +1555,7 @@ iterations of the loop.
15551555

15561556
end = STACK.pop()
15571557
start = STACK.pop()
1558-
STACK.append(slice(start, stop))
1558+
STACK.append(slice(start, end))
15591559

15601560
if it is 3, implements::
15611561

Doc/library/socket.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,13 @@ Constants
704704

705705
.. versionadded:: 3.12
706706

707+
.. data:: SHUT_RD
708+
SHUT_WR
709+
SHUT_RDWR
710+
711+
These constants are used by the :meth:`~socket.socket.shutdown` method of socket objects.
712+
713+
.. availability:: not WASI.
707714

708715
Functions
709716
^^^^^^^^^

Doc/library/struct.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,9 @@ Notes:
279279
(1)
280280
.. index:: single: ? (question mark); in struct format strings
281281

282-
The ``'?'`` conversion code corresponds to the :c:expr:`_Bool` type defined by
283-
C99. If this type is not available, it is simulated using a :c:expr:`char`. In
284-
standard mode, it is always represented by one byte.
282+
The ``'?'`` conversion code corresponds to the :c:expr:`_Bool` type
283+
defined by C standards since C99. In standard mode, it is
284+
represented by one byte.
285285

286286
(2)
287287
When attempting to pack a non-integer using any of the integer conversion

Doc/library/sys.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1712,7 +1712,7 @@ always available.
17121712

17131713
To enable, pass a *depth* value greater than zero; this sets the
17141714
number of frames whose information will be captured. To disable,
1715-
pass set *depth* to zero.
1715+
set *depth* to zero.
17161716

17171717
This setting is thread-specific.
17181718

0 commit comments

Comments
 (0)