summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* gh-93691: fix too broad source locations of for statement iterators (#120330)Irit Katriel2024-06-126-8/+63
|
* gh-120029: make `symtable.Symbol.__repr__` correctly reflect the compiler's ↵Bénédikt Tran2024-06-127-6/+100
| | | | | | | | | | flags, add methods (#120099) Expose :class:`symtable.Symbol` methods :meth:`~symtable.Symbol.is_free_class`, :meth:`~symtable.Symbol.is_comp_iter` and :meth:`~symtable.Symbol.is_comp_cell`. --------- Co-authored-by: Carl Meyer <carl@oddbird.net>
* gh-101575: document Decimal.__round__() (GH-101737)Owain Davies2024-06-121-0/+42
|
* gh-118908: Fix completions after namespace change in REPL (#120370)Lysandros Nikolaou2024-06-122-5/+12
|
* gh-120385: Fix reference leak in symtable (#120386)Kirill Podoprigora2024-06-121-1/+3
| | | Decref 'new_ste' if symtable_visit_annotations() fails.
* gh-120056: Add `IP_RECVERR`, `IP_RECVORIGDSTADDR`, `IP_RECVTTL` to `socket` ↵Nikita Sobolev2024-06-123-0/+16
| | | | | | | | | | | module (#120058) * gh-120056: Add `IP_RECVERR` and `IP_RECVTTL` to `socket` module * Fix news * Address review * Update NEWS
* gh-120221: Deliver real singals on Ctrl-C and Ctrl-Z in the new REPL (#120354)Pablo Galindo Salgado2024-06-112-4/+6
|
* gh-120198: Fix race condition when editing __class__ with an audit hook ↵Ken Jin2024-06-114-2/+38
| | | | active (GH-120195)
* gh-120326: Include <intrin.h> on Windows with Free Threading (#120329)Kirill Podoprigora2024-06-112-0/+6
|
* gh-118908: Limit exposed globals from internal imports and definitions on ↵Eugene Triguba2024-06-114-8/+83
| | | | new REPL startup (#119547)
* Fix typo in ElementTree docs (#120342)naglis2024-06-111-1/+1
|
* gh-120343: Do not reset byte_col_offset_diff after multiline tokens (#120352)Lysandros Nikolaou2024-06-113-1/+18
| | | Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* gh-119517: Fixes for pasting in pyrepl (#120253)Matt Wozniski2024-06-116-57/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove pyrepl's optimization for self-insert This will be replaced by a less specialized optimization. * Use line-buffering when pyrepl echoes pastes Previously echoing was totally suppressed until the entire command had been pasted and the terminal ended paste mode, but this gives the user no feedback to indicate that an operation is in progress. Drawing something to the screen once per line strikes a balance between perceived responsiveness and performance. * Remove dead code from pyrepl `msg_at_bottom` is always true. * Speed up pyrepl's screen rendering computation The Reader in pyrepl doesn't hold a complete representation of the screen area being drawn as persistent state. Instead, it recomputes it, on each keypress. This is fast enough for a few hundred bytes, but incredibly slow as the input buffer grows into the kilobytes (likely because of pasting). Rather than making some expensive and expansive changes to the repl's internal representation of the screen, add some caching: remember some data from one refresh to the next about what was drawn to the screen and, if we don't find anything that has invalidated the results that were computed last time around, reuse them. To keep this caching as simple as possible, all we'll do is look for lines in the buffer that were above the cursor the last time we were asked to update the screen, and that are still above the cursor now. We assume that nothing can affect a line that comes before both the old and new cursor location without us being informed. Based on this assumption, we can reuse old lines, which drastically speeds up the overwhelmingly common case where the user is typing near the end of the buffer. * Speed up pyrepl prompt drawing Cache the `can_colorize()` call rather than repeatedly recomputing it. This call looks up an environment variable, and is called once per character typed at the REPL. The environment variable lookup shows up as a hot spot when profiling, and we don't expect this to change while the REPL is running. * Speed up pasting multiple lines into the REPL Previously, we were checking whether the command should be accepted each time a line break was encountered, but that's not the expected behavior. In bracketed paste mode, we expect everything pasted to be part of a single block of code, and encountering a newline shouldn't behave like a user pressing <Enter> to execute a command. The user should always have a chance to review the pasted command before running it. * Use a read buffer for input in pyrepl Previously we were reading one byte at a time, which causes much slower IO than necessary. Instead, read in chunks, processing previously read data before asking for more. * Optimize finding width of a single character `wlen` finds the width of a multi-character string by adding up the width of each character, and then subtracting the width of any escape sequences. It's often called for single character strings, however, which can't possibly contain escape sequences. Optimize for that case. * Optimize disp_str for ASCII characters Since every ASCII character is known to display as single width, we can avoid not only the Unicode data lookup in `disp_str` but also the one hidden in `str_width` for them. * Speed up cursor movements in long pyrepl commands When the current pyrepl command buffer contains many lines, scrolling up becomes slow. We have optimizations in place to reuse lines above the cursor position from one refresh to the next, but don't currently try to reuse lines below the cursor position in the same way, so we wind up with quadratic behavior where all lines of the buffer below the cursor are recomputed each time the cursor moves up another line. Optimize this by only computing one screen's worth of lines beyond the cursor position. Any lines beyond that can't possibly be shown by the console, and bounding this makes scrolling up have linear time complexity instead. --------- Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net> Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
* gh-120346: Respect PYTHON_BASIC_REPL when running in interactive inspect ↵Pablo Galindo Salgado2024-06-112-1/+4
| | | | mode (#120349)
* gh-119180: PEP 649 compiler changes (#119361)Jelle Zijlstra2024-06-1128-328/+609
|
* gh-120080: Mark test_round_with_none_arg_direct_call as cpython_only (#120328)Kirill Podoprigora2024-06-112-0/+2
|
* gh-120291: Fix a bashism in python-config.sh.in (#120292)Michał Górny2024-06-112-4/+6
| | | | | | | | | | gh-120291: Fix bashisms in python-config.sh.in Replace the use of bash-specific `[[ ... ]]` with POSIX-compliant `[ ... ]` to make the `python-config` shell script work with non-bash shells again. While at it, use `local` in a safer way, since it is not in POSIX either (though universally supported). Fixes #120291
* gh-120298: Fix use-after-free in `list_richcompare_impl` (#120303)Nikita Sobolev2024-06-113-1/+21
| | | Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-65454: avoid triggering call to a PropertyMock in ↵blhsing2024-06-113-0/+12
| | | | NonCallableMock.__setattr__ (#120019)
* gh-119600: mock: do not access attributes of original when new_callable is ↵Robert Collins2024-06-114-5/+29
| | | | | | | | | | set (#119601) In order to patch flask.g e.g. as in #84982, that proxies getattr must not be invoked. For that, mock must not try to read from the original object. In some cases that is unavoidable, e.g. when doing autospec. However, patch("flask.g", new_callable=MagicMock) should be entirely safe.
* Fix the CODEOWNERS for _interpretersmodule.c (gh-120288)AN Long2024-06-101-1/+1
|
* gh-120057: Add os.environ.refresh() method (#120059)Victor Stinner2024-06-107-4/+124
|
* gh-119786: copy compiler doc from devguide to InternalDocs and convert to ↵Irit Katriel2024-06-102-0/+653
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | markdown (#120134) * gh-119876: move compiler doc from devguide to InternalDocs Copy of https://github.com/python/devguide/commit/78fc0d7aa9fd0d6733d10c23b178b2a0e2799afc Co-Authored-By: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-Authored-By: Adam Turner <9087854+aa-turner@users.noreply.github.com> Co-Authored-By: Brett Cannon <brett@python.org> Co-Authored-By: Carol Willing <carolcode@willingconsulting.com> Co-Authored-By: Daniel Porteous <danielporteous1@gmail.com> Co-Authored-By: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com> Co-Authored-By: Éric Araujo <merwok@netwok.org> Co-Authored-By: Erlend Egeberg Aasland <erlend.aasland@innova.no> Co-Authored-By: Ezio Melotti <ezio.melotti@gmail.com> Co-Authored-By: Georg Brandl <georg@python.org> Co-Authored-By: Guido van Rossum <guido@python.org> Co-Authored-By: Hugo van Kemenade <hugovk@users.noreply.github.com> Co-Authored-By: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Co-Authored-By: Jeff Allen <ja.py@farowl.co.uk> Co-Authored-By: Jim Fasarakis-Hilliard <d.f.hilliard@gmail.com> Co-Authored-By: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> Co-Authored-By: Lincoln <71312724+Lincoln-developer@users.noreply.github.com> Co-Authored-By: Mariatta <Mariatta@users.noreply.github.com> Co-Authored-By: Muhammad Mahad <mahadpy@gmail.com> Co-Authored-By: Ned Deily <nad@acm.org> Co-Authored-By: Pablo Galindo Salgado <Pablogsal@gmail.com> Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com> Co-Authored-By: Stéphane Wirtel <stephane@wirtel.be> Co-Authored-By: Suriyaa ✌️️ <isc.suriyaa@gmail.com> Co-Authored-By: Zachary Ware <zachary.ware@gmail.com> Co-Authored-By: psyker156 <242220+psyker156@users.noreply.github.com> Co-Authored-By: slateny <46876382+slateny@users.noreply.github.com> Co-Authored-By: svelankar <17737361+svelankar@users.noreply.github.com> Co-Authored-By: zikcheng <surfingbyte@gmail.com> * convert to markdown * add to index * update more of the out of date stuff --------- Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Brett Cannon <brett@python.org> Co-authored-by: Carol Willing <carolcode@willingconsulting.com> Co-authored-by: Daniel Porteous <danielporteous1@gmail.com> Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com> Co-authored-by: Éric Araujo <merwok@netwok.org> Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no> Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com> Co-authored-by: Georg Brandl <georg@python.org> Co-authored-by: Guido van Rossum <guido@python.org> Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com> Co-authored-by: Jeff Allen <ja.py@farowl.co.uk> Co-authored-by: Jim Fasarakis-Hilliard <d.f.hilliard@gmail.com> Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> Co-authored-by: Lincoln <71312724+Lincoln-developer@users.noreply.github.com> Co-authored-by: Mariatta <Mariatta@users.noreply.github.com> Co-authored-by: Muhammad Mahad <mahadpy@gmail.com> Co-authored-by: Ned Deily <nad@acm.org> Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Stéphane Wirtel <stephane@wirtel.be> Co-authored-by: Suriyaa ✌️️ <isc.suriyaa@gmail.com> Co-authored-by: Zachary Ware <zachary.ware@gmail.com> Co-authored-by: psyker156 <242220+psyker156@users.noreply.github.com> Co-authored-by: slateny <46876382+slateny@users.noreply.github.com> Co-authored-by: svelankar <17737361+svelankar@users.noreply.github.com> Co-authored-by: zikcheng <surfingbyte@gmail.com>
* gh-115801: Only allow sequence of strings as input for difflib.unified_diff ↵Pieter Eendebak2024-06-103-6/+31
| | | | (GH-118333)
* gh-120155: Fix Coverity issue in zoneinfo load_data() (#120232)Victor Stinner2024-06-101-1/+1
| | | | | | | | | | | | | | | | Declare the 'rv' varaible at the top of the load_data() function to make sure that it's initialized before the first 'goto error' which uses 'rv' (return rv). Fix the Coverity issue: Error: UNINIT (CWE-457): Python-3.12.2/Modules/_zoneinfo.c:1233:5: skipped_decl: Jumping over declaration of ""rv"". Python-3.12.2/Modules/_zoneinfo.c:1284:5: uninit_use: Using uninitialized value ""rv"". 1282| } 1283| 1284|-> return rv; 1285| } 1286|
* bpo-24766: doc= argument to subclasses of property not handled correctly ↵E. M. Bray2024-06-103-15/+39
| | | | | (GH-2487) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-120296: Fix format string of fcntl.ioctl() audit (#120301)Clinton2024-06-101-1/+1
|
* gh-119666: fix multiple class-scope comprehensions referencing __class__ ↵Carl Meyer2024-06-103-13/+36
| | | | (#120295)
* gh-120268: Prohibit passing ``None`` to ``_pydatetime.date.fromtimestamp`` ↵Kirill Podoprigora2024-06-083-0/+9
| | | | | (#120269) This makes the pure Python implementation consistent with the C implementation.
* gh-120276: Fix incorrect email.header.Header maxlinelen default (GH-120277)Clinton2024-06-081-1/+1
|
* gh-120121: Add InvalidStateError to concurrent.futures.__all__ (#120123)AN Long2024-06-082-0/+2
| | | Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* gh-120244: Fix re.sub() reference leak (GH-120245)neonene2024-06-082-0/+2
|
* gh-119258: Eliminate Type Guards in Tier 2 Optimizer with Watcher (GH-119365)Saul Shanabrook2024-06-0813-59/+366
| | | | | | | Co-authored-by: parmeggiani <parmeggiani@spaziodati.eu> Co-authored-by: dpdani <git@danieleparmeggiani.me> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com> Co-authored-by: Ken Jin <kenjin@python.org>
* bpo-37755: Use configured output in pydoc instead of pager (GH-15105)Enrico Tröger2024-06-083-20/+116
| | | | | | | If the Helper() class was initialized with an output, the topics, keywords and symbols help still use the pager instead of the output. Change the behavior so the output is used if available while keeping the previous behavior if no output was configured.
* gh-120242: Fix handling of `[setUp,tearDown]Class` in `test_datetime` (#120243)Nikita Sobolev2024-06-081-15/+21
|
* gh-120225: fix crash in compiler on empty block at end of exception handler ↵Irit Katriel2024-06-073-6/+13
| | | | (#120235)
* gh-119659: Get the datetime CAPI Tests Running Again (gh-120180)Eric Snow2024-06-072-2/+2
| | | | | The tests were accidentally disabled by 2da0dc0, which didn't handle classes correctly. I considered updating no_rerun() to support classes, but the way test_datetime.py works would have made things fairly messy. Plus, it looks like the refleaks we had encountered before have been resolved.
* GH-116380: Move pathlib-specific code from `glob` to `pathlib._abc`. (#120011)Barney Gale2024-06-072-14/+52
| | | | | In `glob._Globber`, move pathlib-specific methods to `pathlib._abc.PathGlobber` and replace them with abstract methods. Rename `glob._Globber` to `glob._GlobberBase`. As a result, the `glob` module is no longer befouled by code that can only ever apply to pathlib. No change of behaviour.
* gh-120155: Fix copy/paste error in HAVE_SUBOFFSETS_IN_LAST_DIM() (#120228)Victor Stinner2024-06-071-1/+1
| | | | | | | | | | | | | | | | Don't hardcode 'dest' in HAVE_SUBOFFSETS_IN_LAST_DIM() macro of memoryobject.c, but use its 'view' parameter instead. Fix the Coverity issue: Error: COPY_PASTE_ERROR (CWE-398): Python-3.12.2/Objects/memoryobject.c:273:14: original: ""dest->suboffsets + (dest->ndim - 1)"" looks like the original copy. Python-3.12.2/Objects/memoryobject.c:274:14: copy_paste_error: ""dest"" in ""src->suboffsets + (dest->ndim - 1)"" looks like a copy-paste error. Python-3.12.2/Objects/memoryobject.c:274:14: remediation: Should it say ""src"" instead? # 272| assert(dest->ndim > 0 && src->ndim > 0); # 273| return (!HAVE_SUBOFFSETS_IN_LAST_DIM(dest) && # 274|-> !HAVE_SUBOFFSETS_IN_LAST_DIM(src) && # 275| dest->strides[dest->ndim-1] == dest->itemsize && # 276| src->strides[src->ndim-1] == src->itemsize);
* gh-120226: Fix test_sendfile_close_peer_in_the_middle_of_receiving on Linux ↵Xi Ruoyao2024-06-071-7/+4
| | | | | >= 6.10 (#120227) The worst case is that the kernel buffers 17 pages with a page size of 64k.
* gh-120200: Fix `inspect.iscoroutinefunction(inspect) is True` corner case ↵Nikita Sobolev2024-06-072-3/+4
| | | | (#120214)
* gh-114264: Optimize performance of copy.deepcopy by adding a fast path for ↵Pieter Eendebak2024-06-072-21/+11
| | | | atomic types (GH-114266)
* gh-110383: Improve 'old string formatting' text in tutorial (#120219)Erlend E. Aasland2024-06-071-3/+5
|
* gh-93691: fix too broad source locations of with-statement instructions ↵Irit Katriel2024-06-073-3/+47
| | | | (#120125)
* gh-120211: Fix tkinter.ttk with Tcl/Tk 9.0 (GH-120213)Serhiy Storchaka2024-06-072-3/+7
| | | | * Use new methods for tracing Tcl variable. * Fix Combobox.current() for empty combobox.
* gh-110383: Clarify "non-integral" wording in pow() docs (#119688)Aditya Borikar2024-06-071-1/+3
|
* gh-120164: Fix test_os.test_win32_mkdir_700() (#120177)Kirill Podoprigora2024-06-071-2/+3
| | | | | Don't compare the path to avoid encoding issues. Co-authored-by: Eryk Sun <eryksun@gmail.com>
* gh-120154: Fix Emscripten/WASI pattern in case statement for LDSHARED (#120173)Michael Allwright2024-06-072-2/+2
| | | Fix Emscripten/WASI pattern in case statement for LDSHARED
* Fix typos in comments (#120188)Xie Yanbo2024-06-0711-11/+11
|
* gh-120080: Accept ``None`` as a valid argument for direct call of the ↵Kirill Podoprigora2024-06-076-7/+20
| | | | | ``int.__round__`` (#120088) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>