Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backport a9a74da 3.13 #119642

Closed
wants to merge 160 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
160 commits
Select commit Hold shift + click to select a range
c844b14
Post 3.13.0b1
Yhg1s May 8, 2024
58d9a9b
[3.13] Run CI on the 3.13 branch (GH-118779) (#118781)
miss-islington May 8, 2024
02d49af
[3.13] Docs: fix typos in documentation (GH-118752) (#118787)
miss-islington May 8, 2024
c6680cd
[3.13] gh-118772: Allow TypeVars without a default to follow those wi…
miss-islington May 8, 2024
c33bba6
[3.13] docs: module page titles should not start with a link to thems…
miss-islington May 8, 2024
8f31af6
[3.13] Format None, True, False and NotImplemented as literals (GH-11…
miss-islington May 8, 2024
7b9ca26
[3.13] gh-117657: Fix data races when writing / reading `ob_gc_bits` …
miss-islington May 8, 2024
09896fc
[3.13] [tests]: Mark ``test_statistics.test_kde_random`` with a ``req…
miss-islington May 9, 2024
632682c
[3.13] gh-118033: Fix `__weakref__` not set for generic dataclasses (…
miss-islington May 9, 2024
d86b494
gh-118486: Update docs for CVE-2024-4030 reference (GH-118737)
zooba May 9, 2024
c4b853f
[3.13] gh-103956: Fix `trace` output in case of missing source line (…
miss-islington May 9, 2024
a98e44a
gh-118802: Fix ACL use in test for non-English Windows (GH-118831)
miss-islington May 9, 2024
738877a
[3.13] gh-118817: Fix `asyncio REPL` on Windows (GH-118819) (#118847)
miss-islington May 9, 2024
62a559a
[3.13] gh-117657: Acquire a critical section around `SemLock.__{enter…
miss-islington May 9, 2024
9d646d0
gh-118773: Use language-invariant SDDL string instead of aliases for …
miss-islington May 9, 2024
098eec9
[3.13] gh-118849: Fix "code will never be executed" warning in `dicto…
miss-islington May 9, 2024
846cfb9
[3.13] gh-118561: Fix crash involving list.extend in free-threaded bu…
miss-islington May 9, 2024
0a23970
[3.13] gh-116984: Make mimalloc header includes relative to the curre…
miss-islington May 9, 2024
d4c6948
[3.13] gh-118846: Fix PGO tests in free-threaded build (GH-118862) (#…
miss-islington May 9, 2024
982c73a
[3.13] gh-117657: Replace TSAN suppresions with more specific rules (…
miss-islington May 9, 2024
00ec116
[3.13] gh-118851: Default ctx arguments to AST constructors to Load()…
miss-islington May 9, 2024
b62cb52
[3.13] Revert "gh-115432: Add critical section variant that handles a…
miss-islington May 9, 2024
d524802
Fix some missing null checks. (GH-118721)
miss-islington May 10, 2024
760b3f0
gh-118689: Doc: fix ePub build (GH-118690)
miss-islington May 10, 2024
7dc9875
gh-118209: Add Windows structured exception handling to mmap module (…
miss-islington May 10, 2024
93fce2d
[3.13] Rename `notimplemented_methods` into `nodefault_methods` (GH-1…
miss-islington May 10, 2024
bb5bf24
[3.13] gh-118789: Restore hidden `_PyWeakref_ClearRef` (GH-118797) (G…
miss-islington May 10, 2024
4480dd8
[3.13] gh-117657: Fix data races reported by TSAN on `interp->threads…
miss-islington May 10, 2024
0874a40
[3.13] Correct the argument names for `secrets.choice` and `secrets.r…
miss-islington May 10, 2024
0becae3
[3.13] gh-117657: Fix QSBR race condition (GH-118843) (#118905)
miss-islington May 10, 2024
6df4913
[3.13] gh-118895: Call PyType_Ready() on typing.NoDefault (GH-118897)…
miss-islington May 10, 2024
b3074f0
[3.13] Rename typing._collect_parameters (GH-118900) (#118917)
miss-islington May 10, 2024
cceb758
[3.13] gh-118846: Fix free-threading test failures when run sequentia…
miss-islington May 10, 2024
7dc9e92
[3.13] gh-117657: Log TSAN warnings to separate files and archive the…
miss-islington May 10, 2024
93ef7aa
[3.13] gh-118921: Add `copy()` method for `FrameLocalsProxy` (GH-1189…
miss-islington May 10, 2024
d309474
[3.13] gh-117655: Prevent `test_strptime` from raising a DeprecationW…
miss-islington May 11, 2024
6e855b3
[3.13] gh-118899: Add tests for `NotImplemented` attribute access (GH…
miss-islington May 12, 2024
9d2c10b
[3.13] GH-118844: Fix build failures when combining --disable-gil wit…
miss-islington May 13, 2024
a8ea966
[3.13] gh-87106: Fix inspect.signature.bind() handling of positional-…
miss-islington May 13, 2024
9418832
[3.13] Improve the `rmtree` doc for `dir_fd` param addition in 3.11 (…
miss-islington May 13, 2024
44995aa
gh-118876: Ensure PC/layout sets ns.temp before using it (GH-118880)
miss-islington May 13, 2024
09d4c07
[3.13] gh-58933: Make pdb return to caller frame correctly when f_tra…
miss-islington May 13, 2024
d1aac22
[3.13] gh-119010: Adds docs about `__type_params__` to `functools.upd…
miss-islington May 13, 2024
c7628b0
[3.13] gh-118998: Handle errors correctly in `tmtotuple` in `timemodu…
miss-islington May 13, 2024
29a2f9c
[3.13] GH-118836: Fix JIT build error when SHT_NOTE section is presen…
miss-islington May 13, 2024
8720006
[3.13] gh-67693: Fix urlunparse() and urlunsplit() for URIs with path…
miss-islington May 14, 2024
54839f0
[3.13] Add yet few cases for urlparse/urlunparse roundtrip tests (GH-…
miss-islington May 14, 2024
041cc2a
[3.13] typing tests: remove some unnecessary uses of `exec()` (GH-119…
miss-islington May 14, 2024
87f683e
[3.13] Itertools docs: fix parameter names and indentation in Python …
miss-islington May 14, 2024
8439d09
[3.13] Misc improvements to the itertools docs (gh-119040) (#119045)
miss-islington May 14, 2024
dd8a61f
[3.13] 3.13 What's New: Add PEP 702 (GH-118922) (#119062)
miss-islington May 15, 2024
e1dfa97
gh-118486: Simplify test_win32_mkdir_700 to check the exact ACL (GH-1…
miss-islington May 15, 2024
f85d59c
[3.13] Remove references to private symbols from zipimport module doc…
miss-islington May 15, 2024
4f81915
[3.13] gh-118760: Fix errors in calling Tkinter bindings on Windows (…
miss-islington May 15, 2024
7c224dd
[3.13] gh-119009: Add gettext target (GH-119006) (#119074)
miss-islington May 15, 2024
bca7fb0
[3.13] Use literal syntax in origin property (GH-119029) (#119083)
miss-islington May 16, 2024
1dc7fcd
[3.13] gh-119064: Use os_helper.FakePath instead of pathlib.Path in t…
miss-islington May 16, 2024
8a4730e
[3.13] Add Tkinter tests for different events (GH-118778) (GH-119091)
miss-islington May 16, 2024
c69fe80
[3.13] gh-108267: Fix object.__setattr__ regression in dataclasses do…
miss-islington May 16, 2024
45fbca9
[3.13] Explain how to install LLVM on Fedora (GH-119100)
miss-islington May 16, 2024
acffe20
[3.13] GH-118943: Fix a race condition when generating jit_stencils.h…
miss-islington May 16, 2024
ada4ad0
[3.13] Fix typos in documentation (GH-119092) (#119116)
miss-islington May 17, 2024
ced71d3
[3.13] gh-119049: Fix incorrect display of warning which is construct…
miss-islington May 17, 2024
374655f
[3.13] Minor improvements to the docs for itertools.tee() (gh-119135)…
miss-islington May 18, 2024
1bb3a9d
[3.13] gh-119078: Clarify venv tutorial (GH-119129) (GH-119142)
miss-islington May 18, 2024
9c2de86
[3.13] gh-119132: Log sys._is_gil_enabled() in test.pythoninfo (GH-11…
miss-islington May 18, 2024
641e59d
[3.13] docs: make mimalloc license text literal (GH-119046) (#119149)
miss-islington May 18, 2024
ec88e9f
[3.13] gh-119132: Update sys.version to identify free-threaded or not…
miss-islington May 18, 2024
9129614
[3.13] gh-119050: Add type hints to libregrtest/results.py (GH-119144…
miss-islington May 18, 2024
7407267
[3.13] GH-118447: Fix handling of unreadable symlinks in `os.path.rea…
miss-islington May 18, 2024
bc5e47c
[3.13] marshal docs: Remove reference to "Sun" (GH-119161) (#119167)
miss-islington May 19, 2024
fdc50ba
[3.13] GH-118447: Fix FreeBSD test failures. (GH-119170) (#119181)
miss-islington May 19, 2024
27b61c1
[3.13] GH-119113: Raise `TypeError` from `pathlib.PurePath.with_suffi…
miss-islington May 19, 2024
3b90807
[3.13] IDLE: fix url in config.py comment (GH-119198) (#119199)
miss-islington May 20, 2024
3a8ab99
[3.13] gh-119121: Fix and test `async.staggered.staggered_race` (GH-1…
miss-islington May 20, 2024
cbf064b
[3.13] typing docs: Fix formatting issue (GH-119210) (#119212)
miss-islington May 20, 2024
a52ed7e
[3.13] gh-119185: Fix typo in `_pyrepl.pager`: `tempfilepager` should…
miss-islington May 20, 2024
8f3fc01
[3.13] [docs] TypeVarTuple default is keyword-only (GH-119215) (#119224)
miss-islington May 20, 2024
e370b64
[3.13] gh-115119: Fall back to bundled libmpdec if system libmpdec is…
miss-islington May 20, 2024
a6b873f
[3.13] GH-119146: Don't run JIT CI on unrelated changes (GH-119226)
miss-islington May 20, 2024
fda3291
[3.13] DOCS: Suggest always calling exec with a globals argument and …
miss-islington May 20, 2024
d8c562a
[3.13] gh-112844: Update CPE references for external dependencies (GH…
miss-islington May 20, 2024
054f1af
[3.13] gh-92081: Fix for email.generator.Generator with whitespace be…
miss-islington May 20, 2024
906f6cb
[3.13] Use correct markup in unittest.mock.reset_mock documentation (…
miss-islington May 20, 2024
b4462aa
[3.13] gh-118760: Restore the default value of tkinter.wantobjects to…
miss-islington May 20, 2024
572b0b0
[3.13] gh-119189: Add more tests for mixed Fraction arithmetic (GH-11…
miss-islington May 20, 2024
071d996
[3.13] gh-119253: use ImportError in _ios_support (GH-119254) (#119265)
miss-islington May 20, 2024
42a8d11
[3.13] gh-119050: Add XML support to libregrtest refleak checker (GH-…
miss-islington May 20, 2024
d8fbe5b
[3.13] gh-108267 Fix another dataclasses docs typo (GH-119277) (#119279)
miss-islington May 20, 2024
24b0e8d
[3.13] gh-118912: Remove description of issue fixed in 3.5 from autos…
miss-islington May 20, 2024
f7303cd
[3.13] gh-119174: Fix high DPI causes turtledemo(turtle-graphics exam…
miss-islington May 21, 2024
db64dae
[3.13] gh-74929: PEP 667 general docs update (gh-119291)
miss-islington May 21, 2024
49ad4d0
[3.13] Use `fail-fast: false` in `mypy.yml` (GH-119297) (#119304)
miss-islington May 21, 2024
f028451
[3.13] gh-119102: Fix REPL for dumb terminal (GH-119269) (#119308)
miss-islington May 21, 2024
1929b7e
[3.13] Docs: Ensure no warnings are found in the NEWS file before a g…
hugovk May 21, 2024
dcb8030
[3.13] gh-119053: Implement the fast path for list.__getitem__ (gh-11…
miss-islington May 21, 2024
d93c4f9
[3.13] GH-119292: Add job to JIT CI to build and test with --disable-…
miss-islington May 21, 2024
11ca1d9
[3.13] GH-110383: Improve Tutorial for Input Ouput (GH-119230) (GH-11…
miss-islington May 21, 2024
256b791
[3.13] gh-110383: Document `socket.makefile()` accepts combined modes…
miss-islington May 21, 2024
8860f83
[3.13] gh-119035: Add Ctrl+← and Ctrl+→ word-skipping keybindings to …
miss-islington May 21, 2024
fef202f
[3.13] Fix typos in documentation (GH-119295) (#119337)
miss-islington May 21, 2024
0582016
[3.13] Docs: Add central references to free-threading-related options…
miss-islington May 21, 2024
f371565
[3.13] gh-119102: Fix REPL for dumb terminal (GH-119332) (#119359)
miss-islington May 22, 2024
f15fbe9
gh-118507 : Refactor `nt._path_is*` to improve applicability for othe…
miss-islington May 22, 2024
e992217
[3.13] gh-118877: Fix AssertionError crash in pyrepl (GH-118936) (#11…
miss-islington May 22, 2024
455b386
[3.13] gh-110383: Align dict.get(), .fromkeys(), and .setdefault() do…
miss-islington May 22, 2024
b5b0e32
[3.13] DOCS: fix error in exec namespace note (gh-119380)
miss-islington May 22, 2024
f757996
[3.13] Clarify that dklen is expected in bytes for the hashlib functi…
miss-islington May 22, 2024
ec484b6
[3.13] gh-119189: Add yet more tests for mixed Fraction arithmetic (G…
miss-islington May 22, 2024
0e61989
[3.13] Fix typos in NEWS entries for 3.13 (GH-119374) (GH-119385)
miss-islington May 22, 2024
414346e
[3.13] Fix version number in use_load_tests deprecation reference (GH…
miss-islington May 22, 2024
6892b40
[3.13] gh-118643: Fix AttributeError in the email module (GH-119099) …
miss-islington May 22, 2024
7214598
[3.13] gh-119306: Break up _pyrepl tests (GH-119307) (#119362)
lysnikolaou May 22, 2024
ac91636
[3.13] gh-111201: Remove readline dependency from the PyREPL (GH-1192…
lysnikolaou May 22, 2024
aefe2e6
[3.13] gh-111201: Add append to screen method to avoid recalculation …
miss-islington May 22, 2024
eafd633
[3.13] gh-119205: Fix autocompletion bug in new repl (GH-119229) (#11…
miss-islington May 22, 2024
a463cd8
[3.13] gh-118893: Evaluate all statements in the new REPL separately …
miss-islington May 22, 2024
bfd9c3e
[3.13] gh-119213: Be More Careful About _PyArg_Parser.kwtuple Across …
miss-islington May 22, 2024
cd39da7
[3.13] Improve `pyrepl` type-annotation coverage (GH-119081) (#119415)
miss-islington May 22, 2024
0841606
[3.13] gh-119247: Add macros to use PySequence_Fast safely in free-th…
miss-islington May 22, 2024
0bd7c87
[3.13] gh-112066: Fix versionadded in PyDict_SetDefaultRef docs (GH-1…
miss-islington May 22, 2024
3e30a38
gh-117505: Run ensurepip in isolated env in Windows installer (GH-118…
miss-islington May 22, 2024
e6e4efc
[3.13] gh-119357: Increase test coverage for keymap in _pyrepl (GH-11…
lysnikolaou May 22, 2024
6bc7fc0
[3.13] gh-113978: Ignore warnings on text completion inside REPL (GH-…
miss-islington May 22, 2024
81440c5
[3.13] Enable some stricter mypy settings on `Lib/_pyrepl` (GH-119077…
miss-islington May 22, 2024
9435124
[3.13] gh-111201: auto-indentation in _pyrepl (GH-119348) (#119427)
lysnikolaou May 22, 2024
a6ed742
[3.13] gh-70795: Rework RLock documentation (GH-103853) (#119436)
miss-islington May 22, 2024
cd35e9d
[3.13] gh-117657: Fix missing atomic in dict_resize (GH-119312) (#119…
miss-islington May 22, 2024
dbff1f1
[3.13] gh-119434: Fix culmitive errors in wrapping as lines proceed (…
miss-islington May 23, 2024
9fa1b4f
[3.13] gh-118911: Trailing whitespace in a block shouldn't prevent th…
lysnikolaou May 23, 2024
58dbb4a
[3.13] gh-111201: Speed up paste mode in the REPL (#119341) (GH-11943…
miss-islington May 23, 2024
89e2689
[3.13] gh-90562: Mention slots pitfall in dataclass docs (GH-107391) …
miss-islington May 23, 2024
dbe4f8a
[3.13] Fix typos in what's new documentation (GH-119448) (#119449)
miss-islington May 23, 2024
251ef2e
[3.13] GH-117195: Avoid assertion error in `object.__sizeof__` (GH-11…
miss-islington May 23, 2024
8fd8cc5
[3.13] gh-119469: Fix _pyrepl reference leaks (GH-119470) (#119471)
miss-islington May 23, 2024
d98d6b1
[3.13] gh-118727: Don't drop the GIL in `drop_gil()` unless the curre…
miss-islington May 23, 2024
c750061
[3.13] gh-119461: Fix ThreadedVSOCKSocketStreamTest (#119465) (#119479)
vstinner May 23, 2024
e27e369
[3.13] GH-113464: Run the JIT interpreter before any other JIT CI (GH…
miss-islington May 24, 2024
c864efb
[3.13] gh-118692: Avoid creating unnecessary StopIteration instances …
miss-islington May 24, 2024
0bab0b3
[3.13] gh-69214: Fix fcntl.ioctl() request type (GH-119498) (#119504)
miss-islington May 24, 2024
217d57f
[3.13] GH-119496: accept UTF-8 BOM in .pth files (GH-119508)
miss-islington May 24, 2024
cc38ee1
gh-118263: Add additional arguments to path_t (Argument Clinic type) …
miss-islington May 24, 2024
392a3d8
[3.13] Regen ``Doc/requirements-oldest-sphinx.txt`` (GH-119520) (#119…
miss-islington May 24, 2024
5544651
[3.13] Misc improvement to the docs for itertools (gh-119529) (#119531)
rhettinger May 24, 2024
f49749c
[3.13] gh-111999: Fix the signature of str.format_map() (GH-119540) (…
miss-islington May 25, 2024
317cc3b
[3.13] FAQ: Add reference to Python version numbering scheme (GH-1192…
miss-islington May 25, 2024
2404cd9
[3.13] gh-99180: Make `StackSummary.should_show_carets` private (GH-1…
miss-islington May 25, 2024
3f0198d
[3.13] docs: fix a few typos identified by codespell (GH-119516) (#11…
miss-islington May 26, 2024
825a5ae
[3.13] gh-111997: Fix argument count for LINE event and clarify type …
miss-islington May 26, 2024
46d7712
[3.13] Fix typos in HISTORY documentation (GH-119453) (#119597)
miss-islington May 27, 2024
f1302c1
[3.13] gh-119467: Fix Py_buffer.format type and correct documentation…
miss-islington May 27, 2024
ba71835
[3.13] Docs: Only install sphinx-autobuild for `make htmllive` (GH-11…
miss-islington May 27, 2024
9edf010
[3.13] gh-119580: Improve version added section for convenience varia…
miss-islington May 27, 2024
8117cb5
[3.13] Misc cleanups and wording improvements for the itertools docs …
miss-islington May 27, 2024
0a4a318
[3.13] Docs: Move inline JavaScript to own file to reduce duplication…
hugovk May 27, 2024
bd9983c
[3.13] gh-119560: Drop an Invalid Assert in PyState_FindModule() (gh-…
miss-islington May 27, 2024
660125f
[3.13] gh-119584: Fix test_import Failed Assertion (gh-119623) (gh-11…
miss-islington May 27, 2024
d58ebf0
[3.13] gh-117398: Add multiphase support to _datetime (gh-119373) (gh…
miss-islington May 27, 2024
7322ff1
[3.13] gh-119317: findall instead of traverse for docutils nodes (GH-…
miss-islington May 27, 2024
9216a53
[3.13] gh-117398: Revert gh-119636, Add multiphase support to _dateti…
ericsnowcurrently May 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[3.13] gh-103956: Fix trace output in case of missing source line (G…
…H-103958) (GH-118834)

Print only filename with lineno if linecache.getline() returns an empty string.
(cherry picked from commit 7c87ce7)

Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
  • Loading branch information
miss-islington and chgnrdv authored May 9, 2024
commit c4b853f2a5a4601806f503f1833dce3a4e8d2b58
25 changes: 25 additions & 0 deletions Lib/test/test_trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from test.support.script_helper import assert_python_ok, assert_python_failure
import textwrap
import unittest
from types import FunctionType

import trace
from trace import Trace
Expand Down Expand Up @@ -559,5 +560,29 @@ def test_run_as_module(self):
assert_python_failure('-m', 'trace', '-l', '--module', 'not_a_module_zzz')


class TestTrace(unittest.TestCase):
def setUp(self):
self.addCleanup(sys.settrace, sys.gettrace())
self.tracer = Trace(count=0, trace=1)
self.filemod = my_file_and_modname()

def test_no_source_file(self):
filename = "<unknown>"
co = traced_func_linear.__code__
co = co.replace(co_filename=filename)
f = FunctionType(co, globals())

with captured_stdout() as out:
self.tracer.runfunc(f, 2, 3)

out = out.getvalue().splitlines()
firstlineno = get_firstlineno(f)
self.assertIn(f" --- modulename: {self.filemod[1]}, funcname: {f.__code__.co_name}", out[0])
self.assertIn(f"{filename}({firstlineno + 1})", out[1])
self.assertIn(f"{filename}({firstlineno + 2})", out[2])
self.assertIn(f"{filename}({firstlineno + 3})", out[3])
self.assertIn(f"{filename}({firstlineno + 4})", out[4])


if __name__ == '__main__':
unittest.main()
16 changes: 12 additions & 4 deletions Lib/trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,8 +565,12 @@ def localtrace_trace_and_count(self, frame, why, arg):
if self.start_time:
print('%.2f' % (_time() - self.start_time), end=' ')
bname = os.path.basename(filename)
print("%s(%d): %s" % (bname, lineno,
linecache.getline(filename, lineno)), end='')
line = linecache.getline(filename, lineno)
print("%s(%d)" % (bname, lineno), end='')
if line:
print(": ", line, end='')
else:
print()
return self.localtrace

def localtrace_trace(self, frame, why, arg):
Expand All @@ -578,8 +582,12 @@ def localtrace_trace(self, frame, why, arg):
if self.start_time:
print('%.2f' % (_time() - self.start_time), end=' ')
bname = os.path.basename(filename)
print("%s(%d): %s" % (bname, lineno,
linecache.getline(filename, lineno)), end='')
line = linecache.getline(filename, lineno)
print("%s(%d)" % (bname, lineno), end='')
if line:
print(": ", line, end='')
else:
print()
return self.localtrace

def localtrace_count(self, frame, why, arg):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix lack of newline characters in :mod:`trace` module output when line tracing is enabled but source code line for current frame is not available.
Loading