Skip to content

Commit 730f02b

Browse files
authored
Merge branch 'main' into gh-145306-browser-export-success
2 parents 759e9a3 + 2e2109d commit 730f02b

File tree

108 files changed

+716
-427
lines changed

Some content is hidden

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

108 files changed

+716
-427
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,7 @@ InternalDocs/jit.md @brandtbucher @savannahostrowski @diegorusso @AA-T
298298
# Lazy imports (PEP 810)
299299
Objects/lazyimportobject.c @yhg1s @DinoV @pablogsal
300300
Include/internal/pycore_lazyimportobject.h @yhg1s @DinoV @pablogsal
301-
Lib/test/test_import/test_lazy_imports.py @yhg1s @DinoV @pablogsal
302-
Lib/test/test_import/data/lazy_imports/ @yhg1s @DinoV @pablogsal
301+
Lib/test/test_lazy_import @yhg1s @DinoV @pablogsal
303302

304303
# Micro-op / μop / Tier 2 Optimiser
305304
Python/optimizer.c @markshannon @Fidget-Spinner

Doc/c-api/frame.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ See also :ref:`Reflection <reflection>`.
5050
5151
Return a :term:`strong reference`, or ``NULL`` if *frame* has no outer
5252
frame.
53+
This raises no exceptions.
5354
5455
.. versionadded:: 3.9
5556

Doc/c-api/typeobj.rst

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1499,6 +1499,52 @@ and :c:data:`PyType_Type` effectively act as defaults.)
14991499
It will be removed in a future version of CPython
15001500

15011501

1502+
.. c:macro:: Py_TPFLAGS_HAVE_VERSION_TAG
1503+
1504+
This is a :term:`soft deprecated` macro that does nothing.
1505+
Historically, this would indicate that the
1506+
:c:member:`~PyTypeObject.tp_version_tag` field was available and
1507+
initialized.
1508+
1509+
1510+
.. c:macro:: Py_TPFLAGS_INLINE_VALUES
1511+
1512+
This bit indicates that instances of this type will have an "inline values"
1513+
array (containing the object's attributes) placed directly after the end
1514+
of the object.
1515+
1516+
This requires that :c:macro:`Py_TPFLAGS_HAVE_GC` is set.
1517+
1518+
**Inheritance:**
1519+
1520+
This flag is not inherited.
1521+
1522+
.. versionadded:: 3.13
1523+
1524+
1525+
.. c:macro:: Py_TPFLAGS_IS_ABSTRACT
1526+
1527+
This bit indicates that this is an abstract type and therefore cannot
1528+
be instantiated.
1529+
1530+
**Inheritance:**
1531+
1532+
This flag is not inherited.
1533+
1534+
.. seealso::
1535+
:mod:`abc`
1536+
1537+
1538+
.. c:macro:: Py_TPFLAGS_HAVE_STACKLESS_EXTENSION
1539+
1540+
Internal. Do not set or unset this flag.
1541+
Historically, this was a reserved flag for use in Stackless Python.
1542+
1543+
.. warning::
1544+
This flag is present in header files, but is not be used.
1545+
This may be removed in a future version of CPython.
1546+
1547+
15021548
.. c:member:: const char* PyTypeObject.tp_doc
15031549
15041550
.. corresponding-type-slot:: Py_tp_doc

Doc/deprecations/pending-removal-in-3.20.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Pending removal in Python 3.20
2121
- :mod:`re`
2222
- :mod:`socketserver`
2323
- :mod:`tabnanny`
24+
- :mod:`tarfile`
2425
- :mod:`tkinter.font`
2526
- :mod:`tkinter.ttk`
2627
- :mod:`wsgiref.simple_server`

Doc/reference/datamodel.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2256,7 +2256,7 @@ Basic customization
22562256
This is intended to provide protection against a denial-of-service caused
22572257
by carefully chosen inputs that exploit the worst case performance of a
22582258
dict insertion, *O*\ (*n*\ :sup:`2`) complexity. See
2259-
http://ocert.org/advisories/ocert-2011-003.html for details.
2259+
https://ocert.org/advisories/ocert-2011-003.html for details.
22602260

22612261
Changing hash values affects the iteration order of sets.
22622262
Python has never made guarantees about this ordering

Doc/using/cmdline.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ Miscellaneous options
390390
Hash randomization is intended to provide protection against a
391391
denial-of-service caused by carefully chosen inputs that exploit the worst
392392
case performance of a dict construction, *O*\ (*n*\ :sup:`2`) complexity. See
393-
http://ocert.org/advisories/ocert-2011-003.html for details.
393+
https://ocert.org/advisories/ocert-2011-003.html for details.
394394

395395
:envvar:`PYTHONHASHSEED` allows you to set a fixed value for the hash
396396
seed secret.

Doc/whatsnew/3.15.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1549,6 +1549,7 @@ New deprecations
15491549
- :mod:`re`
15501550
- :mod:`socketserver`
15511551
- :mod:`tabnanny`
1552+
- :mod:`tarfile`
15521553
- :mod:`tkinter.font`
15531554
- :mod:`tkinter.ttk`
15541555
- :mod:`wsgiref.simple_server`

Lib/locale.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -570,10 +570,6 @@ def _getdefaultlocale(envvars=('LC_ALL', 'LC_CTYPE', 'LANG', 'LANGUAGE')):
570570
except (ImportError, AttributeError):
571571
pass
572572
else:
573-
# make sure the code/encoding values are valid
574-
if sys.platform == "win32" and code and code[:2] == "0x":
575-
# map windows language identifier to language name
576-
code = windows_locale.get(int(code, 0))
577573
# ...add other platform-specific processing here, if
578574
# necessary...
579575
return code, encoding

Lib/profiling/sampling/sample.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ def sample(self, collector, duration_sec=None, *, async_aware=False):
164164
# Don't print stats for live mode (curses is handling display)
165165
is_live_mode = LiveStatsCollector is not None and isinstance(collector, LiveStatsCollector)
166166
if not is_live_mode:
167-
print(f"Captured {num_samples:n} samples in {fmt(running_time_sec, 2)} seconds")
167+
s = "" if num_samples == 1 else "s"
168+
print(f"Captured {num_samples:n} sample{s} in {fmt(running_time_sec, 2)} seconds")
168169
print(f"Sample rate: {fmt(sample_rate, 2)} samples/sec")
169170
print(f"Error rate: {fmt(error_rate, 2)}")
170171

Lib/profiling/sampling/stack_collector.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,13 @@ def export(self, filename):
145145
num_functions = len(flamegraph_data.get("children", []))
146146
total_time = flamegraph_data.get("value", 0)
147147
string_count = len(self._string_table)
148+
s1 = "" if num_functions == 1 else "s"
149+
s2 = "" if total_time == 1 else "s"
150+
s3 = "" if string_count == 1 else "s"
148151
print(
149-
f"Flamegraph data: {num_functions} root functions, total samples: {total_time}, "
150-
f"{string_count} unique strings"
152+
f"Flamegraph data: {num_functions} root function{s1}, "
153+
f"{total_time} total sample{s2}, "
154+
f"{string_count} unique string{s3}"
151155
)
152156

153157
if num_functions == 0:

0 commit comments

Comments
 (0)